Skip to main content

Posts

Using Handbrake on the command line to convert video for the iPod

I downloaded HandBrake to my Ubuntu box, Shubuntu, and converted VOB files to MP4: ~/bin/HandBrakeCLI -i /media/MyBook500-ext3_/neil/media/DVDs/ -o /media/MyBook500-ext3_/neil/media/ipod/movie.mp4 -B 160 -R 48 -E AAC -e x264b30 -f MP4 -m -b 1500 -x frameref=1:bframes=0:nofast_pskip:subq=6:partitions=p8x8,p8x4,p4x8,i4x4:qcomp=0:me=umh:nodct_decimate Unfortunately, iTunes refused to transfer the result to my iPod: wrong format.

Strip bash comments with grep

Sometimes, you just want to see the code ... Let's say you want to look at a bash script, but strip out all the comments. Here's a sample command using grep that will display a bash script, without comments, to stout: grep -v "^#" commented-script.sh Notes: "-v" means invert the selection; i.e., only display the lines in the file that don't match. "^#" is the regular expression that matches "lines that start with #". "^" means only match the beginning of the line. Replace "commented-script.sh" with the file name of the file you want to strip. Tips: This command strips single line comments from any programming language. Just change the comment line character (";" instead of "#" for example). If you just want to read the comments, drop the "-v" switch.

Bash Shell Keyboard Shortcuts For Linux Users

Since the keyboard commands for bash are the same no matter what platform you run your bsh shell on (Mac, Windows, Linux, etc.) it pays to learn a few choice command. Here's a great reference: The default shell on most Linux operating systems is called Bash. There are a couple of important hotkeys that you should get familiar with if you plan to spend a lot of time at the command line. These shortcuts will save you a ton of time if you learn them. Here is the List of Bash Shell Keyboard Shortcuts For Linux Users Ctrl + A - Go to the beginning of the line you are currently typing on Ctrl + E - Go to the end of the line you are currently typing on Ctrl + L - Clears the Screen, similar to the clear command Ctrl + U - Clears the line before the cursor position. If you are at the end of the line, clears the entire line. Ctrl + H - Same as backspace Ctrl + R - Let’s you search through previously used commands more , including Alt keys ... Read the rest of the listing at Bash Shell Keyboa...

Freemind 0.8.0 - Java Mind Map software

FreeMind is mind-mapping software written in Java. I use it to plan web sites, promotions, business plans. It’s great for brainstorming, capturing your ideas and organizing them. Since it’s a cross platform Java application, it will run on Windows, Macs and Linux computers, among others. All you need is the current Java Runtime Environment, which is probably already installed if your computer is up-to-date. I use it on the Mac, and I’ve created a SmartFolder to find my FreeMind (*.mm) files quickly. I’ve tested sharing files with Linux, and it works like a champ, although some of the keyboard shortcuts are a little different across platforms. You can (and will) use your mouse, though -- drag-and-drop, collapse and expand (with a double click) let you zip around your mind maps and focus on the details you want, or zoom out to see the big picture. Import/Export & Sharing FreeMind uses an XML file format, meaning that you can read it with a text editor (Text Edit, Notepad, etc....

Installing a private certificate server

Installing a private certificate server, Linux version: Edit /etc/httpd/conf/httpd.conf and change "<VirtualHost _default_:443>" to "<VirtualHost 192.168.10.200:443>" [root@dts conf]# cd /etc/httpd/conf/ssl.key [root@dts ssl.key]# openssl genrsa -out server.key 1024 [root@dts ssl.key]# cd ../ssl.crt [root@dts ssl.crt]# openssl req -new -key ../ssl.key/server.key -x509 -out server.crt Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:New York Locality Name (eg, city) []:New York Organization Name (eg, company) [Internet Widgits Pty Ltd]:Grb-internal Organizational Unit Name (eg, section) []:. Common Name (eg, your name or your server's hostname) []:192.168.10.200 Email Address []: larnd@grb.xxxxx.org [root@dts ssl.crt]# service httpd restart From What Keeps You Off of Windows?

Ubuntu Desktop Effects problems

I had to turn off the cool Desktop Effects in Ubutunu 7.04 today, because the computer stopped responding to the mouse again. When this happens, I can still move my cursor around, but clicks don't do anything. I end up killing X (Ctrl-Shift-Backspace) and rebooting, since logging back in results in another error: Nautilus can't load.

Ubuntu 7.04 Files: Find, use USB

I want to move my Halo files from my NTFS volume to a USB drive (2 GB Attache). Where are they? I figured it out, but I have to set up Desktop Search to index all the volumes -- right now it's just /usr. No wonder it doesn't find anything. So, I found the folder the old fashioned way and copied it to the USB drive, which mounted no problem, and also ejected without a hitch. That's cool.

SmbK4 can't connect

I installed Smb4K and ran it. When I attempted to attach to my Mac (Samba) server, I get this error: smbmnt must be installed suid root for direct user mounts (1000,1000) smbmnt failed: 1 Here's the command I entered to fix it: sudo chmod a+s /usr/bin/smbmnt a+s means "set the suid for all users." That did it.

Notable tar Usages

From the gnu.org site: For example, here is how you might copy a directory's contents from one disk to another, while preserving the dates, modes, owners and link-structure of all the files therein. In this case, the transfer medium is a pipe , which is one a Unix redirection mechanism: $ cd sourcedir; tar -cf - . | (cd targetdir; tar -xf -) Here's a sample: sudo tar cvzf /media/MyBook500-ext3/Volume/home-2007-10-20.tgz /home/

Copy a Directory using tar

Another way to copy directory hierarchies is to use the tar utility, described in section 6.3.7 . The following sequence of commands copies a structure from the source directory to the destination directory: % cd source_dir ; tar cf - . | (cd destination_dir ; tar xfBp -) The " - " is used for the name of the tar file (argument to the f option) so that tar writes to the standard output or reads from the standard input, as appropriate.

Apache and the SUexecUserGroup directive

This is why the server was giving a 500 Internal Server Error when we'd run a script via a browser. From the file /home/httpd/vhosts/ /conf/httpd.conf: There was a directive: SUexecUserGroup user group (The user was a local username and group . The command takes these 2 arguments. It's a cgi wrapper for security and tells spawned scripts to be run as that user and group. It is not used by default. Read more about the whole thing here: http://httpd.apache.org/docs/2.0/suexec.html

Spam Assassin Upgrade Log

son of babbage June 21, 2005 Goal: Use yum to upgrade spamassassin to the most current version (3.03) Issue: Spamassassin 2.61 is already installed and yum won't upgrade it. Solution: Remove existing version and reinstall from the DAG repository. 1. Remove existing version This step will remove spamassassin, the Plesk spamassassin interface, psa-spamassassin, plus the spamassassin section in each user's .qmail file. [admin@localhost admin]$ sudo yum remove spamassassin ... I will do the following: [erase: spamassassin 2.61-3.i586] I will erase these to satisfy the dependencies: [deps: psa-spamassassin 7.0.3-fc1.build040611.14.i586] Is this ok [y/N]: y Running test transaction: Test transaction complete, Success! ===> Reading /etc/psa/psa.conf ... Delete spamassassin preferences from .qmail files for mailnames ... Erased: spamassassin 2.61-3.i586 psa-spamassassin 7.0.3-fc1.build040611.14.i586 Transaction(s)...

Making PCMCIA detection work in Babbage server

Server was preconfigured to have PCMCIA disabled. 1.) Found startup scripts were disabled. They had renamed the startup scripts in these runlevels (2-5) to kill scripts. # mv /etc/rc.d/rc2.d/K96pcmcia /etc/rc.d/rc2.d/S09pcmcia (repeat this for rc3.d, rc4.d, rc5.d directories). 2.) Still gettting "no pcmcia driver in /proc/devices" in /var/log/messages. Also get when you do 'cardctl -v -o' (-o means run once in foreground, -v means verbose) Check file /etc/sysconfig/pcmcia. It looked like: PCMCIA=no PCIC= PCIC_OPTS= CORE_OPTS= It should look like: [kws@localhost sysconfig]$ more pcmcia PCMCIA=yes PCIC=yenta_socket PCIC_OPTS= CORE_OPTS= This is a Dell laptop, all laptops seem to have the same config.

Installing Webmin on Fedora FC1

http://dag.wieers.com/ http://forums.fedoraforum.org/showthread.php?t=45920 http://stanton-finley.net/fedora_core_3_installation_notes.html#Yum Note that for FC3 or later, instead of added to /etc/yum.conf, you add a new file /etc/fum/repos.d/dag.repo (see above links). FC1: instructions: http://dag.wieers.com/home-made/apt/FAQ.php#B 1.) Add this section to /etc/yum.conf, or create the file /etc/yum.repos.d/dag.repo with these contents:) [dag] name=Dag RPM Repository for Fedora Core baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag gpgcheck=1 enabled=1 2.) Add key for dag to rpm: [root@localhost etc]# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt 3.) Install webmin: (with the other dependencies): [root@localhost etc]# yum install webmin Gathering header information file(s) from server(s) Server: Fedora Core 1 - i386 - Base Server: Dag RPM Repository for Fedora Core Server: Fedora Core 1 - i386 - Released Updates Finding updated packages Downloading n...

rsync web pages

rsync is an open source utility that provides fast incremental file transfer, available under the GNU General Public License version 2. rsync is hosted at http://samba.org/ .