Posts

Showing posts with the label config

pull-debian-source with apt-get or "how to download a Debian package from Ubuntu the hard but fun way"

Have you ever wanted to download a Debian  package from an Ubuntu system? Well you are not alone: hidden away in the wonderful " ubuntu-dev-tools " package is the tool for you - the excellent pull-debian-source , written by  tumbleweed . This is a really useful tool which is also fast ! $ sudo apt-get install -y ubuntu-dev-tools $ pull-debian-source hello pull-debian-source: Downloading hello version 2.8-1 pull-debian-source: Downloading hello_2.8.orig.tar.gz from ftp.debian.org (0.665 MiB) pull-debian-source: Downloading hello_2.8-1.debian.tar.gz from ftp.debian.org (0.006 MiB) dpkg-source: info: extracting hello in hello-2.8 dpkg-source: info: unpacking hello_2.8.orig.tar.gz dpkg-source: info: unpacking hello_2.8-1.debian.tar.gz Or, to download the at package from the sid release: $ pull-debian-source at sid pull-debian-source: Downloading at version 3.1.13-1 pull-debian-source: Downloading at_3.1.13.orig.tar.gz from ftp.debian.org (0.117 MiB...

Hiding a regex with vim (aka making C comments disappear)

Image
I use the mighty vim editor for most of my coding. I have a heavily customized setup which has evolved over quite a few years. However, it is by no means a static setup as I keep finding new scripts and tricks (and of course Bram keeps on adding extra goodness with each release). Recently, I was hacking through a lot of C code containing lots of debug cruft (log function calls, commented out bits and pieces, etc). The problem was I couldn't get a feel for the code as all the debug was too distracting. The question popped into my head, "can I hide all this stuff?" A number of folk have come up with ways to "hide" the data you don't want to see in Vim using folds (" :help fold " in Vim). However, that wasn't what I wanted as folds also introduce their own "visual noise". I just wanted this stuff gone . What I came up with is a complete hack, but it suited my purpose rather well: I changed the colour of the regex's matching the ...

making uzbl-tabbed open a link in a new tab (not a new window)

If like me you gravitate towards minimal applications, check out the uzbl web browser. It's based on webkit , supports Java, Flash, CSS, Javascript, etc and has full keyboard control. Added to this, it is fully configurable - it has a standard ASCII config file. This page shows the default keybindings. uzbl is a godsend to those of us who are too lazy (or busy) to take their hands away from the keyboard to reach for the pesky mouse. To install: sudo apt-get install uzbl I'm running uzbl-tabbed (which comes as part of the uzbl package). As the name suggests, this supports tabs. However, I was scratching my head trying to work out how to open a new link in a new tab , rather than a new window . The answer is simplicity itself (once you know of course :-). Fire up your favourite editor and point it at ~/.config/uzbl/config . Then, make sure you have an entry like this: @on_event NEW_WINDOW event NEW_TAB %s Now, any request to open a new window actually ge...

Adding an icon in Ubuntu's Unity for applications which don't provide one

Occasionally, when you're exploring the truly vast range of offerings in the Ubuntu Software Archives via the wonderful Ubuntu Software Centre (or maybe via " apt-cache search "), you might find a graphical application that doesn't have an icon. If this happens, there are 2 things to do: Raise a bug on that application to have an icon added. Add an icon temporarily. Raising a bug is easy, just type: $ ubuntu-bug <thing> Where " <thing> " is either the name of the program you are running, or the package that program lives in. However, you can also quickly add an icon yourself using this simple technique... There are 2 steps: Select your icon Create a "desktop" file Icons are installed in the "/usr/share/icons/" directory by default, so have a browse around to see what you like. If you're still struggling to find an appropriate icon, you could add the package wm-icons which adds over 1500 new ones (!): ...

Starting terminals in tmux in particular directories

I've found a way to tweak my ~/.tmux.conf to create a terminals in particular directories: # start a window in $HOME/foo and call it "bar" set-option default-path "$HOME/foo" neww -n bar # another terminal in a different directory set-option default-path "/var/cache/weird" neww -n weird # revert to default for any further windows set-option default-path "$HOME"