Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Tuesday, June 21, 2011

Entropy Key to work with Fedora

If you don't know what this device is, it is a small USB key that is inexpensive TRNG (True Random Number Generator) device. If you decide to get one of these things and you are not computer, programmer, linux savvy you may have a little trouble getting it up and running without some clear guidance, so I have put together some reproducible steps for installing:


1) I didn't bother trying the provided RPM packages since none were packages specific to fedora

2) Lua is already installed on most systems but you will also need lua-socket, an add on for lua that provides sockets support. You can't just install the lua-socket from yum- you have to make small changes to lua-socket and install manually. The changes required will (a) install lua to the correct place for fedora, (b) add configuration for UNIX domain sockets for lua, which are not enabled in the fedora package.

I did a google search to find the changes I needed (google: lua socket unix diff). The result I found was for FreeBSD but it works the same:
[1] on freebsd-8 (CURRENT):
/src/localcode/lua/luasocket-2.0.2
0  # hg diff
diff --git a/config b/config
--- a/config
+++ b/config
@@ -51,7 +51,7 @@
# Compiler and linker settings
# for Linux
CC=gcc
-DEF=-DLUASOCKET_DEBUG
+DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic
LDFLAGS=-O -shared -fpic
LD=gcc
diff --git a/makefile b/makefile
--- a/makefile
+++ b/makefile
@@ -10,6 +10,8 @@
INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
+#
+INSTALL_UNIX_LIB=$(INSTALL_SOCKET_LIB)

all clean:
      cd src; $(MAKE) $@
@@ -45,6 +47,8 @@
      #cd src; $(INSTALL_DATA) $(TO_MIME_SHARE) $(INSTALL_MIME_SHARE)
      cd src; mkdir -p $(INSTALL_MIME_LIB)
      cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
+       cd src; mkdir -p $(INSTALL_UNIX_LIB)
+       cd src; $(INSTALL_EXEC) $(UNIX_SO) $(INSTALL_UNIX_LIB)/$(UNIX_SO)

#------
# End of makefile
diff --git a/src/makefile b/src/makefile
--- a/src/makefile
+++ b/src/makefile
@@ -47,7 +47,7 @@
      usocket.o \
      unix.o

-all: $(SOCKET_SO) $(MIME_SO)
+all: $(SOCKET_SO) $(MIME_SO) ${UNIX_SO}

$(SOCKET_SO): $(SOCKET_OBJS)
      $(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)



3) Install the patched lua-socket (command: make && make install )

4) Follow the rest of the original instructions for generating a key and running the provided daemon.

To test that your key is working you can run one of the stat tools or just cat /dev/random..

Tuesday, May 19, 2009

Stitched tabs? Mozilla ( my mozconcept )




I can't think of a good name for it but the idea is simple: all tabs are stitched together at the seams and allows for viewing more than one web page at a time and to scroll through open pages. Here are the core concepts:

Watch the VIDEO here which explains it much better:
http://vimeo.com/moogaloop.swf?clip_id=4723419


      1. All tabs are stitched together. The open pages are visible from one to the other and parts of adjacent pages may or may not also be visible.


      2. Borders between pages are adjustable to reflow the layout of the page.


      3. Scaling of each page independently from eachother so the user can work with them completely separately.


      4. Bottom horizontal scroll bar is the default scroll for moving between tabs.


      5. Scrolling for each is independent from the rest


      6. Sidebars can be used to export parts of selected text from one of the browser panes to perform complex actions- like perform a google search in the pane when it is selected or dragged.


      7. Dragging from favorites on sidebar creates new tab- dragging action defines width of the page (as it is loading).


      8. New tabs created in the center with default width, pushing contents to left and right.


      9. Colors flash when the default page changes (the one that has focus in the center) to illuminate which pages are which and which one has focus on the address bar.


      10. Tab labels become editable or accept new addresses.


      11. Border between pages AND border between sections of horizontal scroll bar can be used to adjust widths of the pages.


      12. Width of the tab on the bottom width relative to the page that is being displayed.
      Update: I just saw a video about weave- a new feature targeted at mobile synching of tabs. I think my idea would be a good fit for use in a mobile browser and would make weave more powerful. See the video I saw here: http://vimeo.com/2569344


      Mozilla Labs Design Challenge - Official Concept

      Tuesday, May 12, 2009

      First look: Visual Studio 2008

      Today marks my second week using Visual Studio 2008. I primarily use VS for C++ programming for work using MFC. I have noticed a few glitches such as some of the slowness that affected VS 2005 pre service pack. I then installed SP1 For 2008 and things were good. The only thing I can really say I enjoy about VS9 over VS8 from my perspective (which is severely limited) is that ctrl+j actually works in this version (initiate intellisense). It actually things for a moment and rebuilds the intellisense database where as with 2005 I would usually exit the program and delete the ncb file to rebuild. Besides this I can't say that I have yet to find a major difference between 2005 for the type of work that I am doing. Everything is in the same spot and I'm glad it is.

      Tuesday, March 17, 2009

      C# Samsung TV Remote with Serial RS232

      UPDATE: New link to source code

      This Sunday I was bored, so I made a remote control for my Samsung LC-52SE94U.

      The code I have is incomplete (I didn't implement all the functions, some of the buttons are place holders) but if anyone is interested in picking up where I left off, go ahead.

      For Power On/Off to work properly you must first disable the Energy saver- which is under the 'Power Settings' tab.

      Please let me know if you have found or know of any other codes- I had put in a routine to check all tv codes but I didn't finish running it.

      This software controls the TV using the RS232 port on the back of the set connected directly to a PC. This does not work with infrared.