Posts

Raspberry PI's hardware random number generator for /dev/random

I've stumble upon that Raspberry PI has a built in hardware random number generator. http://scruss.com/blog/2013/06/07/well-that-was-unexpected-the-raspberry-pis-hardware-random-number-generator/ The BCM2835 datasheet also does not provide any info about the RNG. I also found out that the kernel module is also loaded: pi@raspberrypi ~ $ lsmod | grep bcm snd_bcm2835            22317  0  snd_pcm                92397  1 snd_bcm2835 snd                    66972  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device bcm2835_rng             2215  0  bcm2835_gpiomem         3703  0 However, it is currently not fed to /dev/random Also, occasionally, I realize there is a long pause when trying to log in to SSH when the random entropy pool runs out because I'm using it mos...

Simple PIC16F72-based digital clock with DS32KHZ TCXO

Image
Just to keep this blog updated, I've made a digital clock with a DS32KHZ TCXO to provide accurate time keeping. Details are at github: https://github.com/sonofusion82/ds32khz_clock

Fixing USB audio controller (CM108) for headphones

Image
Cheap USB audio controller Recently, I bought a cheap USB audio controller because my motherboard's built-in microphone input was dead. However, there were some problems with the stereo output. It seems to work well when it was connected to a pair of powered speakers, but there was only noise when connected directly to my earphones. When I measured the output voltage, it shows a 2 - 4 V bias voltage which is unusual because it should not have any bias voltages and normally 0 V when no audio. When plugged into my Linux machine, lsusb shows the following: $ lsusb | grep -i audio Bus 005 Device 003: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller So, with a little googling for CM108, I found that the datasheet at  http://www.halicky.sk/om3cph/sb/CM108_DataSheet_v1.6.pdf and also Kevin Custer's site about modifying it http://www.repeater-builder.com/projects/fob/startech-fob.html When I opened up the device and compare it with Kevin Custer's photos,...

Missing xterm on Linux Mint when installing Juniper Network Connect

I was trying to connect to company SSL VPN that uses Juniper Network Connect on Linux Mint 17 64-bit. However, the network connect dialog keeps shutting down after launch for  a few seconds. I've followed their support documentation at http://kb.juniper.net/InfoCenter/index?page=content&id=KB25230 but it was still not working. After a bit digging around, I found the log fail at ~/.juniper_networks/network_connect/installnc.log shows missing xterm. After installing xterm with sudo apt-get install xterm, I can finally connect successfully to the VPN.

Changing nice level for transmission-daemon

Raspberry Pi has rather limited CPU power, so I wanted to reduce the priority of the transmission-daemon. To do that I found that we can modify /etc/init.d/transmission-daemon script to add the --nicelevel option as below: start_daemon () {     if [ $ENABLE_DAEMON != 1 ]; then         log_progress_msg "(disabled)"                 log_end_msg 255 || true     else             start-stop-daemon --start \         --nicelevel 5 \         --chuid $USER \                 $START_STOP_OPTIONS \         --exec $DAEMON -- $OPTIONS || log_end_msg $?                 log_end_msg 0     fi } Reference:  http://man.he.net/man8/start-stop-daemon

Running 2 ethernet connection over single CAT-5e cable

Image
I already have an existing network cable wired from my router to my unifi iptv set-top box at the TV. Currently, I also have my HTPC connected to TV but it uses wifi for Internet connection. So I wondered if I could share the cable for both iptv set-top box and HTPC since wired connection is always better and more reliable than wireless. Adding a switch/hub at TV side will not work because the set-top box requires a dedicated VLAN port on the router that is different from general internet traffic. Since I know that ethernet up to 100Mbps uses only 4 of the 8 wires in CAT-5e, I wondered if I can use the other 4 wires for a separate network connection. I bought 2 RJ-45 splitter to try but realize they were wired parallelly (basically a Y connection for all 8 wires). Therefore I had to break open the splitter and with a little finger dexterity practice to rewire it as below [sorry for the diagram, drawing on tablet also requires significant finger dexterity :-) ]. After some wire cutting...

Merging and encrypting PDF with Ghostscript

Recently I needed to merge several PDF files into a single file and also encrypt it. So after some googling, here my recipe: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOwnerPassword=password1 -sUserPassword=password2 -dKeyLength=128 -dEncryptionR=3 -sOutputFile=output.pdf input1.pdf input2.pdf input3.pdf