Posts

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

Other Utility Mill scipts

I have made several utility mill scripts in the past and since I am reminded of it again, I might as well post links to my other utilities. Hopefully, someone will find it useful: Transmission Return Loss calculator - http://utilitymill.com/utility/ReturnLossCalculator Number to words converter to convert, eg. '123' to 'one hundred and twenty three' - http://utilitymill.com/utility/NumToEnglishWords

srt_delay: subtitle timing delay adjustment

I suppose SRT file timing offset is a common problem, however I can't seems to find any simple good tool that works on both Linux and Windows. While most media player on PC should be able to adjust the delays, my TV set-top box could open SRT files but could not adjust timing delays in the subtitle which could be annoying. So, I decided to roll up my sleeves and wrote the little utility python script in a few minutes. Besides, how difficult could a simple format like this http://en.wikipedia.org/wiki/SubRip ? You can download the script from pastie.org: http://pastie.org/1339071 I've released it as free and public domain . Anyone can use it to do anything you like. Anyway, for Windows folks, I have also made and online version by porting it to excellent python script hosting called Utility Mill . Just go to http://utilitymill.com/utility/srt_delay and follow the instructions.