Thursday, August 24, 2006

Firefox: Extensions and more

Here are some sweet Firefox extensions that I use (if this list isn't enough for you, there's more of them on the Extensions Download Page ):
  • Colorful Tabs An easy way to distinguish between tabs when you have a million open
  • Customize Google a MUST HAVE for frequent users of all Google services... ad blocking, encryption, etc.
  • del.icio.us Social bookmarking site button in your browser! For those of us sick of managing bookmark files. (The classic (worse) version is here)
  • FireBug If you develop web pages without this, you are either uninformed or massochistic
  • YSlow Yahoo tells you why your site is slow (runs on top of FireBug)
  • FireFTP: Why didn't someone think of this sooner? Great idea and execution of an FTP client within a browser.
  • FireGPG Use GPG to encrypt, sign and decrypt email (or any web page text)
  • Google Toolbar 3 Absolute bliss... allows you to add any arbitrary search box as a button in the toolbar and lots of other sweet features that I will not know how to part with
  • Greasemonkey Inject arbitrary Javascript into a page; a great vault of these scripts is found at userscripts.org
  • Nuke anything enhanced Ahh, the pure bliss of deleting something annoying off of a page. Unfortunately, it doesn't seem to want to work with Flash...
  • Viamatic foXpose An OSX-style feature; puts all of your tabs into view at the same time when you hit a button in the chrome of your browser
  • Video DownloadHelper this extension + YouTube = Napster
Other extensions of note:
  • Forecastfox Have to put this one in; my buddy Jon wrote it: displays the local weather in your toolbar
  • Fasterfox Increases your browser speed a minuscule amount and has more popup-blocking capabilities; a good review of it here
  • Chickenfoot Greasemonkey++; saw this demoed... it's great, and only getting better; lots of applications throughout the interweb world
  • Bugmenot Great for getting past login pages that you don't have a login or password for. This activity is illegal, also, perhaps?
  • Adblock Does what it says. Allows contextual filtering of unwanted material from web pages
  • Showcase The same idea as Viamatic foXpose, different implementation.
  • SessionSaver Saves your tabs, text input, etc. from when firefox last closed and reinstates them in your next Firefox session
  • Flashblock: 99% of the time, when a web site uses flash, you don't want to see it. This replaces the flash output with a little button that, if clicked, allows you to see the desired content
  • WebDeveloper: Useful for those who need to debug web pages
  • DownThemAll Great for pulling large quantities off of one page (for me, I use this mostly before I know I'm going to be stranded without internet access for a while)
  • Chatzilla IRC client within the browser (FAQ)
  • MeasureIt For measuring pixels, etc. on your browser screen... simple, but useful
  • View Source Chart for visualizing HTML blocks in the code source
  • Vimperator vim-like commands for Firefox
  • BetterPrivacy prevents Flash cookies from being stored on your computer
Articles about Firefox extensions:
Other:
  • For tweaking Firefox 2 to your personal satisfaction: Lifehacker's top Firefox config tweaks (mostly deals with about:config) and Computerworld's guide
  • To search for something real fast, use the forwardslash key as in vi (or the single quote if you only want to search for links on a page). Ctrl+G moves you forward and Ctrl+Shift+G moves you backwards in searches.
  • Here are instructions for installing firefox 2 on older Ububntu distros (pre-Edgy) that have 1.5 installed by default.
  • For Google-Toolbar-like quickness built into Firefox, right click on your favorite search box and select "Add a keyword for this search"... you'll then be able to search, if you alias search to "g" for example, Google by typing "g <query>" in the URL box
  • Set a master password for logging into sites: instructions here
  • Get the source of a Firefox extension with these instructions

Saturday, August 19, 2006

VIM (and some vi)

Everybody who knows me knows that I love vim. Vim is a powerful version of the vi editor. It usually comes with any *NIX instillation. It rules. Here are some links, and some of my favorite (non-obvious) tricks. If you are new to all of this, a good place to start is the VI lovers home page or, if you are in a hurry, the quick reference card.

VIM

Plain old VI

Tricks
  • Swap two characters xp
  • Swap two lines ddp
  • Reverse the order of all lines :g/^/m0/
  • Remove all lines with only whitespace :g/^\s*$/d
  • Move all lines onto one logical line :%j
  • Remove all blank lines :g/^$/d
  • Insert a newline at the end of every line :%s/$/^m/ (keystrokes to get this one are: Ctrl+V, Ctrl+M)
  • Text completion before, after cursor: Ctrl+N, Ctrl+P (thanks to neha for this link )
  • Get a command prompt :shell
  • Execute a shell command :!<command>
  • Append the contents of a file into your vi session :r!cat <file>
  • Omni-completion Ctrl+X Ctrl+O
  • Whole line completion Ctrl+X Ctrl+L
  • Search for a word forward under the cursor *
  • Search for a word backwards under the cursor #
  • Move to a percentage of the file: type the number, then hit %

XGL/Compiz

I saw my friend using XGL/Compiz on his laptop the other day and was instantly hooked. This technology enables really, really (Vista-like?) pretty graphics and some cool cube-virtual-desktop-switching functionality. Trust me, it's awesome, and once you see it in action, you'll never go back (compiz in action on YouTube). Unfortunately, it's really problematic to install and in heavy development. Needless to say, it's not the most friendly program(s) ever. I'm still trying to get it working on mine, but here's some info in case you want to check it out for yourself:

Links:

Keyboard shortcuts (once everything works...):
  • CTRL + ALT + Left/right arrow key. Switches to the new side of the cube for me.
  • CTRL + ALT + SHIFT + Left/Right arrow key- Takes the in focused app around cube.
  • CTRL + ALT + Left Click on Desktop - allows you to use the mouse to rotate cube.
  • F12 - uses the Expose like trick
  • Alt- Tab - switcher Vista-style
I'm using a Compaq Presario x1000 laptop with a Mobility Radeon 9200 Graphics Card. I start up and then it flickers between the line that says it's running the script /etc/rc.local in the terminal and the ubuntu login screen and a white screen. I also hear the ubuntu drums at the very beginning of this process. Eventually it tells me that there's a problem with the x server (not the garbled, usual problem with the X server output), I hit OK, and it takes me to the Ubuntu login screen. This is all very strange, since /etc/rc.local only has an "exit 0" in it and everything else is commented out. I guess it's not all that big of a problem since I can still log in and use my computer, but it's pretty annoying.

Update: Following these instructions gives me a bit better results, but still doesn't work. At least my computer doesn't go through the whole flickering screen dance but it still starts up with the checkered background while loading and the "X" for the cursor and only allows me to logout and not shutdown. I'm not sure exactly what that means, but I know it means something is funky with the X server. It's also really, really slow with graphics. Perhaps the next walkthrough I run across will be better? John also tried it on his IBM ThinkPad and he failed in his quest as well.

Second update: IT WORKS!!!! Check this unofficial guide out for the instructions I followed. I gather that theses ones are somewhat "safer" than others (no customization that I can find...) which is why it is on this authoritative page.

Third update: check out the sweet video below for a taste of compiz (no, the instructions that worked for me don't have some of the functionality shown, but it's still absolutely sick):



Fourth update: Compiz is installed, but not enabled, by default in Ubuntu 7.04. Enable it by going to the System->Preferences->Desktop Effects menu. There is a great guide to configuring compiz here.

Monday, August 14, 2006

File extentions, compression, and conversion

A constant problem I have is converting file formats from one to another to satisfy the powers that be. This is especially a problem with audio files. I don't want .m4p files from the iTunes store because those are DRMed, which restricts my fair use rights. I don't want .ogg because iTunes can't play them. (As you can see, iTunes causes a lot of problems, but I still have an iPod so... well, my next mp3 player will not be an iPod, for sure.) I've settled on converting all my music to .mp3 as a good compromise. The first step in converting files, my personal choices aside, is to find out what you want to convert to. Here are some sites with some good information:
Now for audio conversions. There's tons of stuff to do this for you on sourceforge and that you can pay for. But, if you don't want to take that route, there are a few key programs that you should know about. The big ones are mplayer, faad, and lame.

Saturday, August 12, 2006

Google Maps info

There's a lot of hype around "Mash-up"s, which is code for doing something with Google Maps. I took a look around and saw what I could find about this emerging phenomena:
Here are some sites that chronicle cool uses of Maps Mash-ups... there is a mash-up for everything, it seems: cheap gas, crime, etc... chances are, if you want it, it's there

Sunday, August 06, 2006

OpenSSH Installation, SCP, SFTP

Installation of OpenSSH was a breeze. Just one command from Breezy Badger (Ubuntu 5.10) server installed it on my server: apt-get install openssh-server. Now I can administer my box from anywhere! Yay! (provided, of course, no power outages, etc...)

To SSH into a server: ssh <username>@<ip address>

To upload a directory recursively (with encryption... blowfish is an encryption algorithm and scp stands for secure copy protocol, a utility available on almost all UNIX-derived machines): scp [-c blowfish] -r <source path> <username>@<target ip address>:<target path> To download over scp, switch the source and target.

For example, to upload from your music collection:
scp -r /home/<username>/Desktop/Musical/Music/Depeche\ Mode/ <username>@<server address>:/home/<username>/Musical/Music/

And to do the opposite (download a directory from the server, in this example to the current directory): scp -r <username>@<server address>:/home/<username>/Musical/ .

Another option is sftp which can perform ftp-like operations (including interactive sessions) over an ssh connection.

Links:
Manpages:

Simple admin commands

Here are some simple sysadmin commands:
  • To create accounts for users (the nice way), the command is adduser <user> which will create an entry in the etc/passwd file and add a home directory for that user (and probably some other stuff, too...)
  • userdel -r <user> delete accounts for users (the nice way) (-r means delete the home directory as well)
  • passwd <user> change a user's password
  • uptime tell how long a system has been running
  • du -h <file/directory> display a human-readable estimation of how much disk space something is taking
  • df -h display a human-readable report of file system disk space usage
  • ps report a snapshot of the current processes
  • ps aux (username, process ID, %CPU, %MEM, virtual memory used (pages), physical memory used, TTY, STAT (process state), date of start, time of start, command)
  • pstree display a tree of processes
  • arp display IP->MAC translation tables
  • acpi display battery status
  • shutdown -h now shut down, power down
  • uname print system information (kernel version, processor, etc)
  • whereis locate the binary, source, and manual page files for a command
  • locate find file names on the whole system FAST (if it's not finding a new file, run updatedb to update locate's index and then run locate again)
  • last -a show a listing of users that have logged into the system and from where
  • screen screen manager (very useful for doing heavy duty stuff on remote systems... see tip #7 of this post for details)
  • free -m display free and total memory in MB (RAM and swap)
  • fuser -v <file> show the user, PID, access type and command accessing of an open file (v for verbose)
  • lsof <file> for even more information than fuser
Important files/places:
  • /proc directory that contains a lot of hardware and system information

Server Building, Part 4 (vsftpd configuration)

Here is some information on configuring vsftpd 2.0.3 on Ubuntu 5.10 (Breezy Badger):

The settings for this program are in /etc/vsftpd.conf There is a short manpage for vsftpd ("man vsftpd" is the command) but the manpage for the file ("man vsftpd.conf") gives a more exhaustive description of options that vsftpd offers. Options are set in option=value form in the config file (example: "anonymous_enable=YES"). Most settings are not enabled if they are not found in the config file but there is some default behavior if some settings are not found. Check the manpage and FAQ for details. I'm mostly concerned with setting up access so that only I can get access to this machine. There are a few types of users in the FTP server paradigm: local users (that have an account on the machine), anonymous users (just anyone on the net) and root. Here are some simple options to set to achieve what I want to do:

Anonymous users:
  • anonymous_enable -- allows anonymous login, on by default
  • anon_upload_enable -- allows anonymous users to upload files... keep this off unless you want a lot of porn on your server (so they say)
  • anon_mkdir_write_enable -- allows anonymous users to use any form of the ftp write command
  • no_anon_password -- allow anonymous users to login without a password... probably a good idea to enable this, since the password is just "anonymous" otherwise

Local users:
  • local_enable -- allows local users to log in... I enable this so I can log in as myself
  • chroot_local_user -- restrict local users to their home directories (apparently a security risk... read the vsftpd FAQ for details)
  • chroot_list_enable -- enables a list of users that can use the chroot() command
  • chroot_list_file -- the location of the file that specifies the users that can use the chroot() command... with my settings, the users listed in this file have full access to the system whereas the users not listed are restricted to their home directories

Other:
  • ftpd_banner -- the message users see when they login
  • write_enable -- enable any form of FTP write (allow users to put stuff on server)

To restart vsftpd with an edited config file (that is, to see the changes you just made to the file put into effect) use this command: /etc/init.d/vsftpd restart