match tab in sed
Posted in Unix on May 17th, 2012 No Comments »
to replace a tab in sed: sed ‘s/<tab>//’ where <tab> is you typing CTRL-V followed by pressing TAB (thanks to atoztoa!). alternatively: sed ‘s/\\\t//’
Posted in Unix on May 17th, 2012 No Comments »
to replace a tab in sed: sed ‘s/<tab>//’ where <tab> is you typing CTRL-V followed by pressing TAB (thanks to atoztoa!). alternatively: sed ‘s/\\\t//’
Posted in Shell Scripting, Unix on August 1st, 2011 No Comments »
i’ve got a bunch of files with one line — a number — and i’d like to sort those filenames on the command line based on that number. to that in one line of shell code: for i in `ls *.*`; do echo “`head -n1 $i` $i” ; done | sort -n
Posted in Unix on November 10th, 2009 4 Comments »
upgraded from squeezebox center 7.1 to 7.4 today and my aac playback broke. to fix, i had to add the following lines to my convert.conf file: mov mp3 * * # FB:{BITRATE=-B %B} [faad] -w -f 2 $FILE$ | [lame] –resample 44100 –silent -q $QUALITY$ $BITRATE$ -x -r – – mov wav * * # […]
Posted in Unix on April 6th, 2009 No Comments »
while trying to upgrade my packages, i got caught with the following error: Removing ghostscript … Purging font configuration of gs… No alternatives for ps2pdf. dpkg: error processing ghostscript (–remove): subprocess pre-removal script returned error exit status 1 Errors were encountered while processing: ghostscript E: Sub-process /usr/bin/dpkg returned an error code (1) to solve it, […]
Posted in Unix on January 28th, 2009 1 Comment »
so a couple of weeks ago, i decided to upgrade the hard drives in my server. previously, i had two 160 GB drives mirrored in a RAID 1 array. there were several partitions in the array. after an impulse newegg buy (curse you and your sales newegg!), i had two 750 GB drives i endeavored […]
Posted in Mac OS X, Unix on January 28th, 2009 3 Comments »
i recently installed some massive hard drives in my server box. given all that space, i thought it’d be perfect to have the mac’s in my house all backup via time machine to those drives. here’s how i got things working. enable sharing on the macs by opening the terminal and entering the command: > […]
Posted in Unix on December 30th, 2008 No Comments »
while replacing a hard drive in my server this weekend, I tried to install GRUB on the replacement hard drive: > /usr/sbin/grub-install /dev/hda only to receive the following error message: /dev/hda does not have any corresponding BIOS drive. this was strange, as I was certain that /dev/hda existed. after some googling, I found the solution: […]
Posted in Unix on August 31st, 2008 3 Comments »
to remove a user and their home directory, use: Â sudo deluser -remove-home <user-name> to remove all of their files on the server: sudo deluser -remove-all-files <user-name>
Posted in Unix, Webserver on August 26th, 2008 No Comments »
to setup my server to use a static ip address i edited the file /etc/network/interfaces to include the lines: iface eth0 inet static name Ethernet LAN card address 192.168.2.100 netmask 255.255.255.0 broadcast 192.168.2.255 network 192.168.2.0 gateway 192.168.2.1 of course, whomever provides you with your static IP address should also be giving you the appropriate information […]
Posted in Perl, Unix on May 13th, 2008 4 Comments »
let’s say you’ve got a string and you’d like to count the number of times some substring appears in it. let’s also assume that you’re lazy and you don’t want to leave your shell terminal to do it. Â fortunately, there’s an easy way to count string matches from the command-line using a perl one-liner. Â Â let’s […]