2011-04-09, Sat
While trying to install yesod using the haskell cabal package manager, I encountered these errors.
cabal: happy is required but it could not be found
language-javascript-0.4.4 failed during the configuration step.
The Exception was: ExitFailure 1
What was missing was an entry in my PATH
variable to point to ~/.cabal/bin
. To fix the problem, I added the following two lines to my ~/.bash_profile
script
PATH=~/.cabal/bin:$PATH
export PATH
Save, and try again.
$ cabal install yesod
— Isaac Su
tags: cabal happy haskell install language-javascript yesod
2011-01-28, Fri
So I had two AVI files that were curiously split into CD1 and CD2 folders in transit, and I wanted to watch them as a single file rather than switching between files halfway through the feature.
Here’s how you can do it using a nifty program called mencoder
mencoder -oac copy -ovc copy -noodml -o ./joined.avi
path-to/file1.avi path-to/file2.avi
(all on a single line)
-oac copy
transfer mode for audio
-ovc copy
transfer mode for video
-noodml
don’t write OpenDML index
-o ./joined.avi
output file
path-to/file1.avi path-to/file2.avi
files you want to join in that order.
To be able to use mencoder
you’ll need to install it by typing this into a terminal.
On Debian/Ubuntu
sudo aptitude install mencoder
On Redhat/Fedora
sudo yum install mencoder
— Isaac Su
tags: avi bash linux mencoder mpeg3 xvid
2011-01-08, Sat
The other night I was wanting to dd
a fresh copy of the ChromeOS image onto an SD card on my eeePC 701.
Problem was, There was only ~700mb of free space on the eeePC’s puny 4GB SSD drive, so there was no way I could fully extract the 1.6gb image before writing it out.
So here’s how you can dd
a image file directly from within a tar.gz archive.
tar xzOf ChromeOS-Flow.tar.gz | dd of=/dev/sdb bs=1M
Allow me to take you through the parameters for tar
one at a time.
x
extract
z
pass it through the gzip filter (i.e. decompress it)
O
send the output through to stdout
f
parameter for the file we’re working with (as opposed to a stream)
The magic is in the O character which allows you to “|” pipe the output from tar
directly to dd
which then writes the stream straight to the block device (in this case /dev/sdb
).
— Isaac Su
tags: bash dd gzip linux stdout tar unix
2010-11-26, Fri
The phpMyAdmin on my local dev machine would take around 5-10 seconds to load up the list of databases in the left frame.
The puzzling thing was that the delay would only come up after a relatively long period of inactivity on the part of the database server which means it’s probably some sort of a caching issue.
Upon consulting the Status tab, the Created_tmp_disk_tables variable was coming up red. The advice given was “you may want to increase the tmp_table_size value”.
It so happens, that was exactly what was needed to be fixed.
- Open up the my.ini file in a text editor.
- Look for the tmp_table_size variable.
tmp_table_size=38M // This was mine
- Change it to something larger like
tmp_table_size=144M
- Restart your MySQL service.
- Enjoy the instant speed bump!
— Isaac Su
tags: database delay list mysql phpmyadmin speed
2010-05-20, Thu
I’ve been working with VirtualBox’s Host-Only Network interface and noticed that Windows 7 automatically places the Host-Only Network interface under the “Public Network” category with no way to change it. Now this is annoying because each time I need to access my Virtual Machine, I’ll need to drop Windows Firewall on Public Network. Here’s how I fixed it.
It turns out, as a security measure, Windows 7 treats any network interface that doesn’t have a gateway set as an “Unidentified Network”. Consequently, all “Unidentified Networks” are placed in the Public Network. Here’s what you need to do to fix it.
- Open up the Network and Sharing Centre.
- Click on the network interface that you would like to convert to Home/Work. This should bring up the Status window for the said interface.
- Click the Details button. Note that there isn’t a value for IPv4 Default Gateway, though, in my case there is an IP Address for the IPv4 DHCP Server. Mine says 192.168.56.100 – note that because it will be a safe dummy IP address to use.
- Close the Network Connection Details dialog box.
- Back on the network interface status window, click on Properties to bring up the Network Properties window.
- Select Internet Protocol Version 4 (TCP/IPv4) and click *Properties.
- Click on Advanced….
- Under Default gateways, click Add and enter a dummy Gateway IP Address (I used 192.168.56.100 for mine).
- Add, OK, OK, OK and Close.
- A window should pop-up asking what category you would like to place the network interface under.
- Congratulations!
— Isaac Su
tags: adapter firewall gateway home interface networking public unidentified windows-7 work