This is test of Pagoda. A locally run web editor for Jekyll which in turn is an awesome way to create a static website from text files.


This is test of Pagoda. A locally run web editor for Jekyll which in turn is an awesome way to create a static website from text files.


Posted in software
25 May 2013
Just a reminder on how to set separate static routes for interfaces in RHEL/CentOS.
[root@zaphod ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.200.0
NETMASK=255.255.252.0
IPADDR=192.168.200.1
USERCTL=no
HWADDR="00:00:00:00:00:00"
NM_CONTROLLED="yes"
TYPE="Ethernet"
UUID="redacted_string"
[root@zaphod ~]# cat /etc/sysconfig/network-scripts/route-eth0
192.168.0.0/16 via 192.168.200.7
[root@zaphod ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.1.200.0
NETMASK=255.255.252.0
IPADDR=10.1.200.200
USERCTL=no
HWADDR="00:00:00:00:00:00"
NM_CONTROLLED="yes"
TYPE="Ethernet"
[root@zaphod ~]# cat /etc/sysconfig/network-scripts/route-eth1
10.200.2.0/24 via 10.1.200.254
10.31.255.0/24 via 10.1.200.254
[root@zaphod ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.31.255.0 10.1.200.254 255.255.255.0 UG 0 0 0 eth1
10.200.2.0 10.1.200.254 255.255.255.0 UG 0 0 0 eth1
10.1.200.0 * 255.255.252.0 U 0 0 0 eth1
192.168.200.0 * 255.255.252.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
192.168.0.0 192.168.200.7 255.255.0.0 UG 0 0 0 eth0
default 192.168.200.7 0.0.0.0 UG 0 0 0 eth0
Posted in hacking
19 Jan 2013
Show all current rules:
[root@zaphod ~]# iptables -L -v
Chain INPUT (policy DROP 1490 packets, 286K bytes)
pkts bytes target prot opt in out source destination
169 1386K ACCEPT all -- lo any anywhere anywhere
1425 114K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
2 128 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ssh
4 256 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1252 packets, 1637K bytes)
pkts bytes target prot opt in out source destination
Dump the rules to standard out:
[root@zaphod ~]# iptables-save
# Generated by iptables-save v1.4.7 on Sat Jan 19 12:58:12 2013
*filter
:INPUT DROP [1645:320384]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1277:1647869]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
COMMIT
# Completed on Sat Jan 19 12:58:12 2013
To save your settings to a file (usefull to import on other systems if your rules are complex):
[root@zaphod ~]# iptables-save > iptables_backup.txt
Easy to import on a different server or if you are testing:
[root@zaphod ~]# iptables-restore < iptables_backup.txt
And the important bit to remember for persistent firewall rules:
[root@zaphod ~]# service iptables save
Posted in hacking
19 Jan 2013
So if you want to remove hashes from the start of a section of lines, in vim normal mode hit CTRL-v and then just use direction keys to select the area you want to remove.
Now hit d.
Posted in hacking
18 Dec 2012
Edit /etc/dnsmasq.conf and add
log-queries
log-facility=/var/log/dnsmasq.log
then make logrotate clean up the log file by creating /etc/logrotate.d/dnsmasq and add
/var/log/dnsmasq.log {
monthly
missingok
notifempty
delaycompress
sharedscripts
postrotate
[ ! -f /var/run/dnsmasq.pid ] || kill -USR2 `cat /var/run/dnsmasq.pid`
endscript
create 0640 dnsmasq dnsmasq
}
Posted in hacking
12 Dec 2012
With a default minimum install of Redhat Enterprise Linux (RHEL) or RHEL without the logos and price tag one gets a very crummy version of vi. Really nasty. And then even when you yum install -y vim and get vim-enhanced then you still have /bin/vi.
Nasty.
So I went looking for a solution.
This one sorts it for all users. And no you don't just want to put an alias in your .bashr/.zshrc because there's all sorts of programmes that don't reference those configs.
Courtesy of Jethro Carr
Change the default /etc/profile.d/vim.sh from this:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
[ -x /usr/bin/id ] || return
[ `/usr/bin/id -u` -le 100 ] && return
# for bash and zsh, only if no alias is already set
alias vi >/dev/null 2>&1 || alias vi=vim
fi
to this:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ];then
if [ -f /usr/bin/vim ]; then
alias vi='vim'
fi
fi
Posted in hacking
07 Dec 2012
I agree with almost all of this except perhaps the bit about keys. I freaking love the way all app preferences share key combinations.
"Should you dump Linux and join me in darkness? How the hell should I know? :-) I’m just sharing my two cents - if you’re happy using Linux you should definitely stick with it. Obviously I wasn’t and there weren’t that many alternatives lying around."
http://batsov.com/articles/2013/09/09/from-linux-to-osx-1-year-later/
Posted in article
30 Nov 2012
:544,600s/^/#
Put a hash at the start of every line from 544-600.
I know, right?
It's ok, you can thank me with beer.
Posted in hacking
18 Oct 2012
perl -ne 'print unless /^\s*[;\$#]|^$/' dhcpd.conf
The benefit of the perl version is that it's not just lines where the first character is a hash but even indented lines whos first character is a hash.
Posted in regex
12 Oct 2012
grep -v '^#' file_with_lots_of_comments_and_blank_lines.conf |grep -v '^$'
Posted in regex
24 Sep 2012
Problem: Laptop goes to sleep while connected to a remote host. Upon resume one can't just ^c or ^d to get back to the local prompt. It's just frozen.
Solution: meta-q in tmux to get the pane number highlighted then tmux killp -t n 'n' being whichever pane you want to kill.
Posted in hacking
15 Sep 2012
Show me the size of all the things. The bastard child of du and df.
alias duf='du -sk * | sort -nr | perl -ne '\''($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}'\'''

Posted in hacking
02 Aug 2012
Following this guide: http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion
I did indeed install the package from the MySQL site.
I wanted to leave my project folders where they live normally in ~/programming/projects/ which meant I had to enable:
Include /private/etc/apache2/extra/httpd-userdir.conf
in /etc/apache2/httpd.conf and create the file /etc/apache2/users/gyaresu.conf to which I added:
<Directory "/Users/gyaresu/programming/projects/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Of course I want multiple websites which of course means Name Based Virtual Hosts so I just added some entries to /etc/apache2/extra/httpd-vhosts.conf like:
<VirtualHost *:80>
DocumentRoot "/Users/gyaresu/programming/projects/phpmyadmin"
ServerName "phpmyadmin"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/gyaresu/programming/projects/workthing"
ServerName "workthing"
</VirtualHost>
Now of course I've got to edit the /etc/hosts file so my computer knows to look locally:
127.0.0.1 workthing
127.0.0.1 phpmyadmin
You'll notice phpmyadmin there. That's just a matter of downloading the package and running the setup as instructed in the linked post.
Now I haven't looked into fixing the next issue I found but I'll update this later when I look into it.
Getting the .htaccess commands to work required an addition to /etc/apache2/httpd.conf:
<Directory "/Users/gyaresu/programming/projects/workthing/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
Of course I don't want to have to add that for every project so we'll see whether it annoys me enough to fix.
So that wasn't terribly hard at all. Great post from coolestguyplanettech.com.
Posted in hacking
01 Aug 2012
I love vim but I'd forgotten to add this snippet to my ~/.vimrc.
When you /search for something in vim it stays highlighted which can get frustrating fast.
Easy way to turn it off, just remap the space bar. Search terms will stay highlighted after a search and let you navigate around but if you want to unhighlight then the space bar will fix it.
Voila!
" Map SPACE to remove search highlighting
nmap <SPACE> <SPACE>:noh<CR>
Posted in hacking
28 Jul 2012
First: Use a file. In this case I simply run tail -f (follow) on a one line script called prompt.sh.
Then background the process CTRL-Z.

Now delete the file and list the open files belonging to tail: lsof -c tail.

Notice that the PID (Process ID) is 4826 and the FD (File Descriptor) is 3r.
The 3 is the kernel auto-incrementing the FD number and the r is for read mode.
Interestingly the kernel starts from 3 because you'll notice 0-2 are taken.
0u /dev/pts/0 # standard in
1u /dev/pts/0 # standard out
2u /dev/pts/0 # standard error
Available modes to open a file:
r = read access
w = write access
u = read and write access
space if mode unknown and no lock character follows
`-’ if mode unknown and lock character follows
And now we can see that the file descriptor is still there but (deleted).

Now that you know which file descriptor it is you can simply make a copy. Either putting it back as the original file name or something different.

Posted in hacking
25 Jul 2012
“when I’m hiring someone, I look for an applicant that fits the culture, who is bright, and who is excited and wants to learn. That’s it. I’m not going to require that they come with prior experience in every component of our stack. Anyone who wants to learn can pick that up on the job.”
Posted in jobhunting
21 Jul 2012
So it looks like the awesome Heroku have come out with a point and click install of PostgreSQL.

Postgres.app - "the easiest way to run PostgreSQL on the Mac".
Documentation:
Posted in hacking
20 Jul 2012
Privoxy is still my favourite ad busting browser proxy.
I installed via Homebrew and then thanks to Frederik De Bleser I used just his Privoxy launch-agent script org.privoxy.privoxy.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.privoxy.privoxy</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/privoxy</string>
<string>/usr/local/etc/privoxy/config</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>WorkingDirectory</key>
<string>/usr/local/etc/privoxy</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/privoxy/output.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/privoxy/output.log</string>
</dict>
</plist>
Posted in hacking
14 Jul 2012
The following is a message I got today on Facebook. You really should read this book.
I read the unnatural history of the sea you advised. It's seriously changed my life. The fish I eat, the things I do, buy and the causes I support. Also I think I'm a better and more appreciative diver. Great advice. I salute you.
I've since past the book on and bought 2 more.

Posted in environment
06 Jul 2012
I've completed my OS rebuild now with the configuration of IRSSI.
Edited config and theme from https://github.com/sorin-ionescu/dot-files/tree/master/irssi.
There was no clear channel indicator so I added prompt = "%c$* >>%n "; in the file .irssi/my.theme.

Posted in hacking
06 Jul 2012

If you don't find this the sexiest terminal setup you've ever seen then you should probably check your pulse because you may be dead.
Inspiration from Seth Brown
irssi theme based on sorin ionescu's
Patched Mensch Regular and Menlo for Powerline
wemux - multi-user terminal multiplexing

Posted in hacking
03 Jul 2012
I've updated the Hubot (I call her raaabot) to the latest version (2.2.1) after some messing around with npmjs.org dependency fun.
But more importantly I've fixed the annoying issue with Freenode kicking users who flood any channel with 5 lines. Even if they've OP status.
heroku config:add HUBOT_IRC_UNFLOOD="false"
And a friendly submission to the wiki at https://github.com/nandub/hubot-irc.
Posted in hacking
02 Jul 2012
http://myusuf3.github.com/numbers.vim
Notice that in normal mode the line numbers are aligned with the cursor which make it easier to do commands like delete 10 lines: d10.

And in visual mode the line numbering is back to full page layout.

Posted in hacking
01 Jul 2012
tmux iTerm2 osx copy/paste
set-option -g default-command "reattach-to-user-namespace -l zsh"
Then hold alt/option key during mouse select.
Posted in hacking
01 Jul 2012
$ curl ifconfig.me/ip
$ curl ifconfig.me/host
$ curl ifconfig.me/ua
$ curl ifconfig.me/all
$ curl ifconfig.me/all.json
Posted in hacking
01 Jul 2012
How can I install the packages from the EPEL software repository?
su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm'
Posted in linux
27 Jun 2012
Spell checking in vim.
:setlocal spell spelllang=en_au
Posted in hacking
24 Jun 2012
gyaresu@zomg:~$ whatis paste
paste (1) - merge lines of files
gyaresu@zomg:~$ whatis nl
nl (1) - number lines of files
gyaresu@zomg:~$ cat a.txt
thing
stuff
ptang
gyaresu@zomg:~$ cat b.txt
yellow
blue
pink
gyaresu@zomg:~$ paste a.txt b.txt > c.txt
gyaresu@zomg:~$ nl c.txt
1 thing yellow
2 stuff blue
3 ptang pink
Posted in hacking
24 Jun 2012

From 1940 to 1949 she;
Made 18 films
Had two children
Co-invented the frequency-hopping spread-spectrum communication system used now in such technology as Bluetooth, Wi-Fi and CDMA
Posted in random
23 Jun 2012
I have a resumé http://gyaresu.org/gareth_cv.pdf and I have a LinkedIn profile http://no.linkedin.com/in/gyaresu.
It doesn't seem right to be too informal or glib in a resumé or job appliction. Maybe it'll be ok to just link to this post? We'll see. [1]
I'm writing this because I don't have the benefit of 'word of mouth' that I used to benefit from. Writing about one's attributes feels so terribly narcissistic.
LOOK AT ME! I'M AWESOME! etc.
The fundamental cause of trouble in the world today is that the stupid are cocksure while the intelligent are full of doubt.
-- Bertrand Russell
I started my on-site computer business in 2002 after 6 months of learning to use a computer.
Whilst in Sydney I'd been given an old ACER laptop with a P2 CPU & 32MB of RAM. That's what I had to work with.
When I landed back in Launceston it was just before the 2002 Elections so I started running the campaign office for the Tasmanian Greens (something I've done since my 20's).
I'd turn up every day and talk to people about politics in between messing with this Windows 98 laptop.
A week or so into this Ray walked in and so began a geeky friendship and lots of foot bag.
The great way Ray had of teaching me about computers was to literally ignore all ridiculous questions and only answer the ones that showed independent research.
It's exactly the behaviour you'll find on IRC still to this day.
Computers are amazing. The internet is amazing. Seriously. MIND BLOWN.
Ever since then I've been able to learn and research and ask and help and interact on so many levels about so much AMAZING information.
I started my business so quickly after learning to use computers for two reasons. First and foremost was that I wanted a job. Second was because I seriously thought I could help enough to be worth paying.
I rang all the on-site computer businesses in town and found the cheapest hourly rate was AU$28.50. So that's what I decided to charge. I also vowed to not charge should I be unable to help a client.
As with any business plan one should always plan for the worst and expect the best. I wasn't disappointed. I quickly found that I could solve every problem presented to me and because I'm a big friendly happy and helpful person, I could communicate the 'why' something needed to be done.
Being fully informed and solving their problems meant that over the years my clients wouldn't even want to know the options, 'just do what you think is best'.
So I'd get all these referrals for work and even other computer businesses would either contact or recommend me for obscure stuff.
I became the Linux guy, and the OS X guy and the wireless networking guy and the BSD guy and the guy who figured out how to drive the programme of a whole range of bizarre, ancient, multi-tonne CNC machines.
GOOD FUN.
My hourly rate went from $28.50 > $50 > $55 > $75 > $100 > $110 > $150 over about four years. That's not even including some of the cool places I've been flown to by the Government for remote work. Can you say junket? Sweeeet.
Oddly, clients are easier to deal with the more you charge. Not because they're better people but because value for money is counter-intuitive. Clients paying $150/hr believe they are getting the best and will therefore trust you know what you're doing. Which of course means that when one is doing charity work (as I was want to do) that you will be constantly questioned over your decisions and skills. Because obviously if you're charging either nothing or very little then you're value is the equivalent. Bizarre but true.
This period of my life was the longest spent in any one place. I was comfortable in my job but itching to see more of the world. So I sold my business. While travelling in Queensland I went out to the Great Barrier Reef on a boat with 300 hundred other people. Two years later after an apprenticeship and a LOT of excellent training from people I still greatly respect I was a senior diver, running that boat and teaching at a dozen sites in Fiji.
I've taken a few thousand people diving and taught people who are now instructors themselves. 13hrs/day 7 days a week (with the occasional weekend off).
BECAUSE I'M PASSIONATE.
That's it really. Passion. I want you to know I'm passionate.
Work is a time trade-off for money. I carry no debt and live frugally enough that I never have to stay in a bad situation. That's freedom. It also means I have the luxury of being honest. I want to get up in the morning and do things that matter. I also want to keep learning. It's scary and frustrating and exciting but being completely ignorant of a topic makes for a fantastic rush of learning.
I'm currently contracting to work remotely on Linux servers. I can still keep doing that (hey, the money's great) but I'd like to work with others on something special.
So if you'd like a friendly hard working passionate man to join your organisation. Please feel free to contact me.
Gareth
[1] I've also found it infuriating to read job postings. They are just so full of BS.
Posted in work
22 Jun 2012
Great looking color scheme for vim: Gummybears.vim
Font: 14 point Menlo Regular

Syntastic: vim syntax checking plugin on vim.org

Tmux copy/paste in OS X:
$ brew install reattach-to-user-namespace
set-option -g default-command "reattach-to-user-namespace -l zsh"
Posted in hacking
19 Jun 2012
Source: Coderwall - A better git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
Then git lg or git lg -p

Posted in hacking
19 Jun 2012
On the internet there are many irssi-notify.pl/notify.pl/growl.pl/growl-notify.pl scripts that just don't work.
This is an irssi script that works brilliantly on OS X 10.7
https://github.com/sorin-ionescu/irssi-growl
I upgraded my perl CPAN Bundle: sudo perl -MCPAN -e 'install Bundle::CPAN'
Then installed the two required modules: Growl::GNTP and IO::Socket::PortState
Copied the png and script into place and voila!
Posted in hacking
18 Jun 2012
Fresh OSX install makes for interesting times. I'll experiment with the vimrc of others and give feedback.
http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
Posted in hacking
15 Jun 2012
OSX's /usr/bin/vim isn't compiled with +clipboard so you can replace it with:
$ brew install macvim --override-system-vim
Posted in osx
25 May 2012
https://github.com/github/hubot/wiki/Deploying-Hubot-onto-Heroku
https://github.com/nandub/hubot-irc
https://github.com/github/hubot-scripts
https://grove.io/help/integrations/hubot
And because it's on freenode there's a 5 line flood-kick setting that can't be changed so that's why I've linked to this page.
* EDIT 2012-07-02 I found a config for Heroku that fixes the flooding problem. My post on the fix for Hubot getting flood kicked on Freenode
chat.freenode.net #gyaresu
help - Displays all of the help commands that raaarbot knows about.
help <query> - Displays all help commands that match <query>.
raaarbot <anything related to size, speed, quality, specific body parts> - raaarbot will "that's what she said" that ish
image me <query> - The Original. Queries Google Images for <query> and
knowing is half the battle - display "The Battle" image
map me <query> - Returns a map view of the area returned by `query`.
math me <expression> - Calculate the given expression.
mustache me <url> - Adds a mustache to the specified URL.
mustache me <query> - Searches Google Images for the specified query and
pug bomb N - get N pugs
pug me - Receive a pug
script info <script> - Print script help
script list [-l] - List all availiable scripts (optional -l for list mode)
script load <script> - Load a script
ship it - Display a motivation squirrel
show storage - Display the contents that are persisted in redis
show users - Display all users that raaarbot knows about
sosearch me <query> - Search for the query
sosearch me <query> with tags <tag list sperated by ,> - Search for the query limit to given tags
task add <task> - Add a task
task delete <task number> - Delete a task
task list tasks - List the tasks
translate me <phrase> - Searches for a translation for the <phrase> and then
translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
who is <user> - see what roles a user has
wiki me <query> - Searches for <query> on Wikipedia.
xkcd - The latest XKCD comic
xkcd <num> - XKCD comic matching the supplied number
youtube me <query> - Searches YouTube for the query and returns the video
Posted in programming
05 May 2012
I've been teaching myself JavaScript and Python for the last six months and thought now was a good time to open up my private repository hosted on GitHub.
I've started with a fresh repo as my original private repo had too many keys & mess in it.
You can see the working version here http://oslogigs.com
It's a web app for finding the price of øl (beer) in pubs and venues around Oslo, Norway.
It uses a Google map with numbered markers.
I intend to continue on it and hopefully add http://twillio.com authentication via sms so that the site is fully automated for price updates.
So if you're in Oslo and find the price either missing or wrong, let me know.
Posted in development
29 Apr 2012
...fixing current templating system...
Well I was.. Until I found out that my changes to the Jekyll template file weren't getting updated on http://gyaresu.github.com
So now I need to wade back into the Jekyll code and figure out what it actually does when it's generating the static content.
I mean, the local version works fine. It's only relying on the Github server to re-run the config and generate new static code from the templates based on the new config.
sigh
This was meant to be easier...
Posted in
19 Apr 2012
Today's office brought to you by awesomeness.
I'm currently sitting in a beautiful little wooden building. It has three levels and feels like a treehouse.
Updating online profiles to better find work and wrestling with a new JavaScript framework found via Hacker News.
Posted in travel
10 Apr 2012
Somewhere in the world there is still a computer crunching data for research into protein folding: Folding@Home
...that I set up in 2004... :O
Posted in computers
29 Mar 2012
Installed the latest version of zsh via Macports.
Setup of oh-my-zsh involves cloning the Github repo, picking a theme and choosing which plugins to use.
oh-my-zsh automatically checks for updates and pulls new versions.
The plugins are excellent. Rails, git, OSX, hub, capistrano, brew, ant, macports, etc.
And zsh as usual is fantastic. Just use it to find out why.
You'll never want to go back to bash after using it.
Posted in programming
21 Mar 2012
ack is Better than Grep
$ ack --pager="less -R" search_term
Posted in
16 Mar 2012
Now this is how you sell a t-shirt:
INCLUDES DOWNLOAD OF THE FULL FLOEX CATALOGUE WITH THE PURCHASE OF THE T-SHIRT (ZORYA, POCUSTONE, MACHINARIUM OST, SAMOROST II OST) AND ONE SPECIAL UNRELEASED BONUS TRACK!!! FREE DOWNLOAD CODES WILL BE SENT TO YOU BY E-MAIL, BONUS TRACK IMMEDIATELY.
Posted in music
16 Mar 2012
Posted in criticism
15 Mar 2012
Mondays & Wednesdays between 01:00-03:00. Sounds about right.
Posted in programming
15 Mar 2012
http://vimeo.com/album/1534761
I read each of the 16 stories from David's book.
The Cat and the Baboon The Migrating Warblers The Squirrel and the Chipmunk The Toad, The Turtle, and the Duck The Motherless Bear The Mouse and the Snake The Parenting Storks The Faithful Setter The Crow and the Lamb The Sick Rat and the Healthy Rat The Cow and the Turkey The Vigilant Rabbit The Judicious Brown Chicken The Parrot and the Potbellied Pig Hello Kitty The Grieving Owl
Posted in stuff
18 Feb 2011
An inspiring TED talk from an economist.
"Being persuaded to spend money we don't have on things we don't need to create impressions that won't last on people we don't care about." - Tim Jackson
Posted in stuff
07 Oct 2010
I've been installing software and tweaking my main site via the iPhone today. I'm using a bunch of plugins for Wordpress and a couple of iPhone apps to assist me in controlling my content creation.
Mainly I just don't want to directly submit any more of my life through places like Facebook and Twitter where I don't even get to own it. I'm ok for now submitting still to these 'free' services but only until I figure out a complimentary system.
I got screwed by Apple today. Seems like my new laptop hadn't really shipped a week ago like they said. Apparently next week for sure! Muppets.
Till then only as many experiments as I can be bothered with on this little screen.
Don't even get me started on doing any real work via iPhone touch screen.
Time for an experiment!
Posted in stuff
05 Oct 2010
I've been thinking a lot as usual about our future and the very different lives we lead as a result of technology.
We are not controlling our online lives. Just try accessing your old Facebook or Twitter posts.
Most people won't change their current ways until there's a reason to.
I endeavor to beat a path for others to follow. I know from the outset I'm not alone in this and I hope there will be critical mass to move away from these gilden cages.
p.s. Big shout out to future me! Flying cars yet?
Posted in security
05 Oct 2010
So apart from becoming a diving instructor living in Airlie Beach and generally being warmer, nothing much has happened since my last post (Ha!).
I'm waiting for delivery of a nikon 35mm f1.8 lens (AU$299).
Said lens will give me a 52mm equivalent on my Nikon D80.
This will be one of the main projects for the foreseeable future.
http://www.nikon.com.au/productitem.php?pid=1310-8934b9b612
http://www.dpreview.com/lensreviews/nikon_35_1p8g_n15/
http://www.kenrockwell.com/nikon/35mm-f18.htm
Posted in stuff
02 Jun 2010
DNS (Domain Name System) is one of those truly wonderful chunks of knowledge that you can get away with outsourcing but in the end you really need to know wtf is going on.
I have a soft spot for DNS. I know that I don't know enough and yet I know more than most.
It's a wonderful place to focus your knowledge. Especially with IPV6 coming along while gazzilions of admins around the world chant the chorus to "la la la la la la la la la la la la" with fingers firmly stuck in ears.
It's the glue of the internet. There really no way around it.
You may drive one of a thousand cars on the internet highway. TCP/UDP implementations of JSON/HTML/XML/SQL/BLAHBLAHBLAH but DNS tells everyone where to go.
Here's to you DNS. WIth your spoofing and your new found vulns you still rock my world.
Tip of the Hat!
Posted in stuff
04 Oct 2009
Posted in stuff
30 Sep 2009
Well I'm still living out of a backpack and the ideas of what to do with my life are starting to mount up.
What a strange position to be in. I have a couple of businesses that tick over and only require me to work from the interwebs. So now I'm physically free but can't decide where it is I should put my person.
Peru and their AU$130/month iphone plans with unlimited data?
Australia in a campervan?
London and Linux sysadmin?
Well I was quite looking forward to Amsterdam and Greenpeace sysadmin but UK Passport office helpline for passports #fail means UK passport in 12 months. I'll have another chat with Greenpeace then perhaps.
What to do till then?
Christof Rehage has an amazing youtube clip that is a must-see http://www.thelongestway.com
That's given me the inspiration to think about walking up the eastern seaboard of Australia. I could work and walk, losing some desperately unwanted kilos.
Will walking be so much different to driving. I know the coastal route of Australia pretty well in that lazy hop-to-hop next-pretty-place kind of way. Have laptop will travel?
Do I need to get a cart built? What about charging camera/laptop/iphone?
Should I be doing this in Europe, South America, China, South East Asia?
Buggered if I know. Maybe something positive to do with the Copenhagen Climate summit?
Just starting to walk could be a good idea.
Posted in me
07 Sep 2009
Changing the media type to audiobook:
iPod on my iPhone 3G was removing the audiobooks I was listening to at strange times. On sync or even just plugging in the power. So a little research found that with iTunes 8 you can select a Genre then 'cmd + a' >> right click >> options and change "Media Kind" to "Audiobook". Tick "Remember Position" and "Skip when shuffling" >> Ok.
Sorted.
Next problem was having upgraded my drive to a 500GB 7200RPM Seagate (465GB irl) the Time Machine was showing insufficent space on the external 500GB drive as it needed to backup 469GB.
Problem is that there's only 390GB on the laptop drive. Hmmm. The internets doesn't seem to want to help on this one either.
Solution:
Under "Options" on the Time Machine preferences panel you can click the wee "+" button and add folders or even entire drives that you don't want TM to backup. What I discovered was that TM isn't really sure how much stuff you have on your internal drive until it has a crack at it. Problem is it also adds a 20% buffer to its estimation. What needed to be done was add almost all of the large folders (Applications, Users) and let it have a go at backing up the few remaining ones first. This done you go back and remove all the other folders from "Do not back up:" and let it run again. Voilá!
Posted in stuff
07 Sep 2009
Well apart from a dismal rushed attempt to write a resumé in 2002 I've gotten along just fine without needing one.
The time has come though where some of the interesting jobs I want to apply for are on the other side of the world and there's no chance to look them in the eye and shake their hand.
So...
Research. I've done the http://delicious.com search and found a great Rands piece http://www.randsinrepose.com/archives/2007/02/25/a_glimpse_and_a_hook.html
There's a pile of good examples here: http://jobmob.co.il/blog/beautiful-resume-ideas-that-work/
So. Best get to it.
EDIT: The funny and talented Zed Shaw http://zedshaw.com/ offered his resumé template and build system in TeX.
It draws on using pygments and idiopidae to do the syntax highlighting. You then use vellum to build it. Plus use tetex not latex.
How awesomely geeky is that for doing a resumé.
I really really appreciate it when people go out of their way to help others.
I better go do some duty in the IRC rooms now :)
Posted in stuff
06 Aug 2009
Cursor movement h - move left j - move down k - move up l - move right
ctrl+f page forward
ctrl+b page backwards w - jump by start of words (punctuation considered words) W - jump by words (spaces separate words) e - jump to end of words (punctuation considered words) E - jump to end of words (no punctuation) b - jump backward by words (punctuation considered words) B - jump backward by words (no punctuation) 0 - (zero) start of line ^ - first non-blank character of line $ - end of line G - Go To command (prefix with number - 5G goes to line 5)
Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines. Insert Mode - Inserting/Appending text i - start insert mode at cursor I - insert at the beginning of the line a - append after the cursor A - append at the end of the line o - open (append) blank line below current line (no need to press return) O - open blank line above current line ea - append at end of word Esc - exit insert mode Editing r - replace a single character (does not use insert mode) J - join line below to the current one cc - change (replace) an entire line cw - change (replace) to the end of word c$ - change (replace) to the end of line s - delete character at cursor and subsitute text S - delete line at cursor and substitute text (same as cc) xp - transpose two letters (delete and paste, technically) u - undo . - repeat last command Marking text (visual mode) v - start visual mode, mark lines, then do command (such as y-yank) V - start Linewise visual mode o - move to other end of marked area Ctrl+v - start visual block mode O - move to Other corner of block aw - mark a word ab - a () block (with braces) aB - a {} block (with brackets) ib - inner () block iB - inner {} block Esc - exit visual mode Visual commands
- shift right < - shift left y - yank (copy) marked text d - delete marked text ~ - switch case Cut and Paste yy - yank (copy) a line 2yy - yank 2 lines yw - yank word y$ - yank to end of line p - put (paste) the clipboard after cursor P - put (paste) before cursor dd - delete (cut) a line dw - delete (cut) the current word x - delete (cut) current character Exiting :w - write (save) the file, but don't exit :wq - write (save) and quit :q - quit (fails if anything has changed) :q! - quit and throw away changes Search/Replace /pattern - search for pattern ?pattern - search backward for pattern n - repeat search in same direction N - repeat search in opposite direction :%s/old/new/g - replace all old with new throughout file :%s/old/new/gc - replace all old with new throughout file with confirmations Working with multiple files :e filename - Edit a file in a new buffer :bnext (or :bn) - go to next buffer :bprev (of :bp) - go to previous buffer :bd - delete a buffer (close a file) :sp filename - Open a file in a new buffer and split window ctrl+ws - Split windows ctrl+ww - switch between windows ctrl+wq - Quit a window ctrl+wv - Split windows vertically
Posted in stuff
21 Jul 2009
It started here: A black OS X Leopard Terminal theme that is actually readable
and referenced here: http://ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal
Which led to this awesome vim package:http://github.com/adamhjk/adam-vim/tree/master
Posted in stuff
11 Jul 2009
Posted in stuff
01 Jul 2009
http://www.google.com/a/cpanel/domain/new
Because they all but don't link to it any more.
Posted in stuff
22 Jun 2009
Now I admit to a lot of excitement about the iPhone and its wonderful interactivity but really what we need is going to need to be 'open'.
No royalties, no control. No restrictions.
Computers and hardware that every hobbyist with a shed can participate in. Or every artist with a techy bent.
So that's why I share this fantastic article that I found. Why the Arduino Matters
Posted in stuff
28 May 2009
Hi Matt.
I've held off a month before writing you this email because I didn't want it to come across as a personal attack.
One of the reasons I initially chose to go with Bluehost was because of your excellent blog.
Unfortunately there's nothing that can change the way I feel now when someone mentions your company (please note again, not a personal attack).
Around the 19th March 2009 my bluehost account giantfriend.com was closed and all data deleted without warning or even explanation.
Bluehost had always been my main hosting site (around 14 websites) and I have a server in Sydney (I'm in Australia) for latency important sites.
This is my business and of course all of my clients relied on DNS email & site hosting from me.
I spent the next week after this catastrophe attempting to get the account reinstated and all the sites back.
Although the bluehost staff are friendly and helpful there was no-one who could tell me what the problem was that caused account deletion and no-one could retrieve any backups at all.
I have no idea if this was a violation of the terms or a mistake or an overzealous sysadmin. My entire account was just 'gone'.
Needless to say I was absolutely gutted and don't need to tell you that there should have been some measures in place to protect from this now apparent 'Sword of Damocles'.
To the best of my knowledge the account was using ~5GB of data & serving up pretty standard php/mysql based websites. There was no file sharing or dodgy content on the server.
I include the first email I received as none of the subsequent emails or phone calls provided any more clarity:
Dear Gareth:
Your web hosting account for giantfriend.com has been deactivated
(reason: call customer support).
Although your web site has been disabled, your data may still be available for
up to 15 days, after which it will be deleted.
If you feel this deactivation is in error, please contact customer support as
soon as possible.
Thank you,
BlueHost.Com Support
http://www.bluehost.com
For support go to http://helpdesk.bluehost.com/
Toll-Free: (888) 401-4678
Please feel free to contact me if you have any questions.
Posted in stuff
27 May 2009
Key:
^ = control
meta = alt (usually)
Delete the line: ^u
Delete the word before the cursor: meta+backspace
Paste the last deleted thing: ^y
Go to the start of the line: ^a
Go to the end of the line: ^e
Go backwards by word: meta+b
Go forwards by word: meta+f
Posted in stuff
10 May 2009
Say you've got your webserver listening on port 80 and all requests from your router for webpages point to it (server0).
Now say that server0 handles Name based Virtual Hosts. So the one Apache web server is hosting a whole bunch of domains: example.com example2.com example3.com etc.
What do you do if you want to run a second server (server1)on the same IP address?
Well you could have another server there just to load balance or you could get the router to do it (if it was smart enough).
But another way is to setup server0 to proxy connections of your choice over to server1.
/etc/apache2/mods-enabled/proxy.conf
Server1 has Name based Virtual Hosts as well and doesn't need any special configuration.
03 May 2009
"who is your greatest artisan"
That's the question I want to ask from the towns that I travel to.
The more I learn the more I realise it's the mentors that have imparted the most knowledge. Even when they're pompous ass'.
I needs me a mentor.
Posted in stuff
19 Apr 2009
wget --mirror -w 2 -p --html-extension --convert-links -P -H -Dexample.com ~/path/to/save/locally http://example.com
mirror, wait 2 seconds, get all required elements, convert extensions to html, convert links to work locally, prefix folder, enable spanning across hosts when doing recursive retrieving, set domains to be followed, path to put stuff, domain.
Posted in linux
05 Mar 2009
http://www.gotoquiz.com/results/do_you_have_biblical_morals
Your morality is 0% in line with that of the bible.
Damn you heathen! Your book learnin' has done warped your mind. You shall not be invited next time I sacrifice a goat.
Posted in stuff
26 Feb 2009
http://rackerhacker.com/2008/11/02/syncing-an-iphone-with-a-new-mac-without-hassles/
Make sure that iTunes is not running on both Macs. Disconnect your iPhone/iPod from both Macs. Copy your iTunes folder. /Users/username/Music/iTunes Copy your iPhone/iPod backups. /Users/username/Library/Application Support/MobileSync Copy your iTunes configuration files. /Users/username/Library/Preferences/com.apple.iTunes* Open iTunes on your new Mac and verify that Applications and Ringtones appear. Connect your iPhone/iPod to the new Mac and accept any new authorizations. Use iTunes on your old Mac to de-authorize the computer.
Posted in stuff
26 Feb 2009
"It's not surprising, therefore, that projects tended to be behind schedule. Take a plan that's created according to a generic formula, estimate the work in advance of any significant knowledge of requirements, have the estimates done by people who won't be doing the work, never update the plan after work is started, and what do you get? Lousy plans... and they were treated as unquestionable truths."
http://jamesshore.com/Change-Diary/
Posted in stuff
26 Feb 2009
Hobart - Casino
Amazing
but...
You people need to stop using flash cameras THEY DONT WORK AT A DISTANCE.
And the yelling out...
...die.
Posted in stuff
17 Feb 2009
How to recursively make all the folders in the current path executable without doing the same to all the files.
Man, why do I always forget this!
find -type d -print0 |xargs -0 chmod 755
find -type f -print0 |xargs -0 chmod 644
Posted in linux
12 Feb 2009
"i before e except after c"
beige, cleidoic, codeine, conscience, deify, deity, deign, dreidel, eider, eight, either, feign, feint, feisty, foreign, forfeit, freight, gleization, gneiss, greige, greisen, heifer, heigh-ho, height, heinous, heir, heist, leitmotiv, neigh, neighbor, neither, peignoir, prescient, rein, science, seiche, seidel, seine, seismic, seize, sheik, society, sovereign, surfeit, teiid, veil, vein, weight, weir, weird
Posted in stuff
06 Nov 2008
OSX: Preferences >> Input /Codecs >> Access modules >> File >> Raise caching value from 300ms to something (800ms).
Posted in linux
28 Oct 2008
[quicktime]http://gyaresu.org/wp-content/uploads/2008/10/panorama.mov[/quicktime]
Posted in quicktime
19 Oct 2008
[quicktime]http://gyaresu.org/wp-content/uploads/2008/10/higgs-track.mov[/quicktime]
Click & Drag. Press the + & - to zoom.
Posted in quicktime
14 Oct 2008
Using Ellipsoid: (14) International
Zone: 55g
Easting: 0426165
Northing: 5370619
Latitude: 41 deg 48 min 43.66213 sec South
Longitude: 146 deg 6 min 40.02203 sec East
Posted in photos
06 Oct 2008
I say we take off, and nuke the entire site from orbit. It's the only way to be sure.
Posted in linux
03 Oct 2008
SilverStone HTPC LC17S
Corsair 620w PSU
Gigabyte EP45-DS3L
Intel Core2Duo Quad Q6600 @2.8GHz
Nvidia 8800GT 512MB
x2 2GB DDR2
500GB SATA HDD
Pioneer Sata DVD
AOC 24" LCD
CHIMEI 22" LCD
iDeneb v1.1 Mac OSX 10.5.4
Cost: ~$1600
Mac Store price for Mac Pro equivalent: $7700
Posted in linux
25 Sep 2008
http://rfacebook.wordpress.com/2008/08/06/quickstartfacebooker/
Posted in linux
05 Sep 2008
The reason you have to use
dpkg --force-confmiss is because whenever your config files (
Posted in linux
29 Aug 2008
slave:~# gem install god Bulk updating Gem source index for: http://gems.rubyforge.org/ Building native extensions. This could take a while... ERROR: Error installing god: ERROR: Failed to build gem native extension./usr/bin/ruby1.8 extconf.rb install god extconf.rb:1:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:1
Gem files will remain installed in /var/lib/gems/1.8/gems/god-0.7.8 for inspection. Results logged to /var/lib/gems/1.8/gems/god-0.7.8/ext/god/gem_make.out
Solution: Install dev libraries.
slave:~# sudo apt-get install ruby1.8-dev linux-libc-dev libc6-dev
Posted in linux
10 Aug 2008
http://www.redmine.org
http://www.redmine.org/wiki/redmine/RedmineInstall
http://obsessivecollaborator.com/2008/05/redmine-up-and-running.html
cPanel's easyapache scripts are the only way to fly (or all bets are off, you wanna play go build a debian server).
http://www.cpanel.net/support/docs/ea/ea3/
Posted in linux
10 Aug 2008
So set the systemwide python to be python2.4.
This is a note to self when everything else breaks from using the old version.
cd /usr/bin sudo rm python sudo ln -s python2.4 ./python
EDIT: That fraked all sorts of things. Looks like hellanzb from the cli for now.
Posted in linux
09 Jul 2008
A flickr plugin. This is me in Sydney 2000. I just really like the shot. Skinny happy and tanned wearing a 'wifebeater' on the madman. Happy days.

07 Jul 2008
So new house only has phone line in the kitchen. Solution: WDS using Tomato of course.
So now I have one wrt54g connecting to the net in PPPOE Bridge mode with a billion modem (meh, average modems).
And one wrt54g in my office that acts as an extension of the main one. So plug that into a switch and all the computers here in the office can connect via ethernet.
One more for the lounge and the movie/music server and I'm sorted.
http://www.polarcloud.com/tomato
http://www.polarcloud.com/tomatofaq#how_do_i_use_wds

Posted in linux
06 Jul 2008
The important bit is 'force user' and 'force group' otherwise your local user won't have permissions to the shared directory.
sudo apt-get install samba
/etc/samba/smb.conf
Changes:
security = share
guest account = nobody
[stuff] writeable = yes path = /stuff public = yes guest ok = yes guest only = yes guest account = nobody force user = gyaresu force group = users browsable = yes
sudo /etc/init.d/samba restart
Posted in linux
04 Jul 2008
Uh oh, dead link... apparently you gotta pay now. http://linuxinside.org/flickr/
Posted in linux
24 Mar 2008
Ever sent mail from the wrong email address because you forgot to select the correct identity in the compose window?...
Posted in linux
09 Feb 2008
So I tried the 8800GT 512MB to see whether crysis would run 'aight. No go.
Anyway, while messing around with the card under linux I upgraded the nvidia drivers to the latest from the nvidia site (ubuntu doesn't have them in the repos yet).
My stupid second monitor couldn't have its stats detected (edid).
So off I go AGAIN fsck'ing around with xorg.conf and Xorg.0.log files to figure out what's changed THIS driver release.
Anyway: The Error
root@sdf:~/x11# cat /var/log/Xorg.0.log.old |grep -i edid (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-1 (--) NVIDIA(0): DPI set to (90, 88); computed from "UseEdidDpi" X config
The Fix (get the edid.bin from the one working monitor under nvidia-settings, look in the GPU settings. You can save it from there.)
Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "1" Option "CustomEDID" "DFP-1:/home/gyaresu/edid.bin" Option "RenderAccel" "true" Option "metamodes" "DFP-0: nvidia-auto-select +1680+0, DFP-1: nvidia-auto-select +0+0; DFP-0: 1680x1050 +0+0, DFP-1: NULL" EndSection The result:
root@sdf:~/x11# cat /var/log/Xorg.0.log |grep -i edid (**) NVIDIA(0): Option "CustomEDID" "DFP-1:/home/gyaresu/edid.bin" (--) NVIDIA(0): DPI set to (90, 88); computed from "UseEdidDpi" X config
meh.
Posted in linux
19 Jan 2008
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();
Posted in linux
30 Dec 2007
mp -ao alsa:device=hw=1.0 -dvd-device /path/to/VIDEO_TS dvd://1
Posted in linux
28 Dec 2007
Note to self: Remeber to change the /etc/ddclient.conf file on host 'slave' when you update the password for zoneedit.com.
Posted in linux
04 Nov 2007
Because sometimes you just want a pretty front end to convert that flac format album you bought off Bleep.com to mp3.
Posted in linux
30 Oct 2007
Browser.tabs.tabMinWidth is the Firefox configuration value that determines the tab width. Here is how to disable tab scrolling:
Posted in linux
28 Oct 2007
http://www.lifehack.org/articles/lifehack/how-to-read-and-write-ntfs-windows-partition-on-mac-os-x.html
Posted in linux
17 Oct 2007
This has been rattling around in my brain ever since I read/saw the combo years ago.
Now it's my new business motto.
Posted in linux
12 Oct 2007
The freaking /boot/grub/menu.lst item below defines where the grub root is. Don't be fooled by the cunning hash, that isn't a comment...
# groot=(hdx,x)
Posted in linux
11 Oct 2007
Source: http://www.ilovebacon.com/071706/f.shtml "This works great !!! Good for when all your family is together. The best part is that no one has to wait for their special omlette and no frying! Have guests write their name on a quart-size Ziploc freezer bag with permanent marker. Crack 2 eggs (large or extra-large) into the bag (not more than 2) shake to combine them. Put out a variety of ingredients such as: cheeses, ham, onion, green pepper, tomato, hash browns, salsa, etc. Each guest adds prepared ingredients of choice to their bag and shake. Make sure to get the air out of the bag and zip it up. Place the bags into rolling, boiling water for exactly 13 minutes. You can usually cook 6-8 omelets in a large pot. For more, make another pot of boiling water. Open the bags and the omlette will roll out easily. Be prepared for everyone to be amazed. Nice to serve with fresh fruit and coffee cake; everyone gets involved in the process and a great conversation piece.
Imagine having these ready the night before, and putting the bag in boiling water while you get ready. And in 13 minutes, you got a nice omlette for a quick breakfast!!!
I used tomatoes, ham, green onions, cheddar cheese and mushrooms in this one! MMMMMMMM . . .MMMMMMM good!!!"
Posted in linux
08 Oct 2007
I run MPD as my music player because it's FREAKING AWESOME. It's a daemon so you can basically connect to it any way you want: command line interface ncmpc or via your browser with Pitchfork or a GUI like Sonata.
Of course one needs one's Last.FM submissions and fortunately MPDScribble does the job.
<edit: 2008/08/07>
I'm now using Mint Linux (currently the most useable debian based Linux imho) and MPDScribble is fubar for some unknown reason (I've spent days looking at it). So instead installed lastfmsubmitd to submit to last.fm & lastmp to get the info from mpd. They've both got lovely ncurses setup screens that asks your lastfm name/password & what group you want to run the daemon under. Brilliant.
http://www.red-bean.com/~decklin/software/lastfmsubmitd/
So today I tweaked the mpd.conf to output to multiple audio streams. One to my awesome NAD C 320BEE amp & Quad 22L's, and the other to my server running icecast2.
So now I can login to my server http://LikeI'mGoingToTellYou.org/mpd/ to access Pitchfork & http://LikeI'mGoingToTellYou.org:8000 to grab the stream.
All I have to do is grab foobar2000 and I can now listen to all of my rather extensive music collection from anywhere in the world.
It's like taking home with me everywhere I go. Sigh I feel all gooey on the inside.
Posted in linux
08 Oct 2007
Source: http://www.linuxtutorialblog.com/post/tutorial-playing-around-with-mplayer
This tutorial handles about the usage of the wonderful media player MPlayer. It explains several options, lists some useful keyboard shortcuts and handles about tips and tricks that can be used to enhance your multimedia experience.
Difficulty: Basic
Note: this tutorial assumes that you have MPlayer installed & working and that you have some basic shell knowledge.
Playing a file
The most simple way of invoking MPlayer to play a media file is this:
[rechosen@localhost ~]$ mplayer
MPlayer will try to auto-detect what kind of file you're trying to play (it usually succeeds) and play it. If it's an audio file, it'll just start playing and show its status and possible warnings on the command-line. If it's a video file, it'll open a window to play it in and then start playing.
Seeking through a file
You can seek through a file with a set of 3 keyboard shortcut pairs. Each pair makes MPlayer seek a different amount of time, and the pair consists of a key for seeking backward and a one for seeking forward. Listed below are those key pairs, for seeking backward and forward respectively: Left arrow and Right arrow (10 seconds) Down arrow and Up arrow (1 minute) Page down and Page up (10 minutes)
Knowing these will come in handy a lot of times.
Playing a DVD
MPlayer does not have DVD menu support (sadly), but it does support playing DVD's. You can play a DVD this way:
mplayer dvd://
Replace
Playing with subtitles
You can play a movie with subtitles in multiple ways. When playing a movie file, you can specify a subtitle file this way:
[rechosen@localhost ~]$ mplayer -sub
When playing a DVD movie, you can also use the DVD's subtitle by specifying a language code like this:
[rechosen@localhost ~]$ mplayer dvd://
The above command would try to use dutch subtitles first, and fall back on english ones if dutch subtitles weren't available.
Useful keyboard shortcuts
A list of useful keyboard shortcuts (sometimes called hotkeys) in MPlayer:
(note that the full list can be found in MPlayer's man page) "f" => Toggle between full-screen and windowed mode during video playback (you can set the option -fs on the command line to make MPlayer start playing in full-screen mode immediately) "o" => Switch OSD (OnScreen Display) mode during video playback (for viewing how much time the movie has been playing and what its total lenght is) "p" or Space => Pause / resume playback "q" or Esc => Quit MPlayer (Esc does not quit but only stops playback when in GUI mode) "/" and "" (or "9" and "0") => Decrease / increase playback volume respectively "m" => Mute sound (toggle) "T" (usually Shift + "t") => Toggle stay-on-top (very useful if you don't want your video window to be overlapped by an other application) "b" and "j" => Cycle through available subtitles "x" and "z" => Adjust subtitle delay (useful if you have a subtitle that isn't 100% synced; you can then correct the time difference on the fly) "I" (usually Shift + "i") => Show the filename of the movie being played (useful if you want to know that without interrupting the movie) "1" and "2" => Adjust contrast "3" and "4" => Adjust brightness "5" and "6" => Adjust hue "7" and "8" => Adjust saturation*
*: These do not always work; see the MPlayer man page.
Generating an index
Sometimes, video files (mainly AVI files) have a corrupted index, or no index at all. This frequently is the case with incorrectly or incompletely downloaded files. Fortunately, MPlayer can generate the index it needs to play the file correctly. By using the -idx option, you can tell MPlayer to generate an index when necessary:
[rechosen@localhost ~]$ mplayer -idx
[rechosen@localhost ~]$ mplayer -forceidx
Generating an index can take some time, depending on the size of the video file, but after that, the file should play correctly.
Correcting bad audio/video sync
Some videos (mainly flv files) are encoded in a horrible way, and MPlayer will have enormous trouble with the A/V (Audio/Video) sync. There are pretty much two possibilities in this case: MPlayer is trying to fix it but the sync is worsening too fast MPlayer is trying to fix something that's already right and therefore pushes the sync away unnecessarily
In the first case, you should allow MPlayer to try harder to fix the sync:
[rechosen@localhost ~]$ mplayer -autosync 30 -mc 2.0
In the second case, you shouldn't allow MPlayer to fix anything when it comes to the sync:
[rechosen@localhost ~]$ mplayer -autosync 0 -mc 0
You might wonder what those options mean. Well, setting autosync to a positive value allows MPlayer to gradually adapt its A/V correction algorithm. The higher the value, the faster MPlayer will try to correct it. The mc option specifies how many seconds MPlayer may correct every frame. Setting it to a high value (like 2.0) practically allows MPlayer to do whatever it thinks it should to correct the A/V sync. Setting it to 0 stops MPlayer from trying anything when it comes to syncing.
Using MPlayer on slow systems
As video playback is a CPU-intensive task, older and slower systems may have a hard time to play certain video files. MPlayer has a feature that will help them to keep up the playback with less CPU power: -framedrop. This will allow MPlayer not to render a frame here and there if the CPU can't handle it. On systems that are far too slow, it won't be a pleasure to "watch" the movie (the majority of the frames will just not be rendered at all), but on systems that are a bit faster, this will stop the playback from having hiccups here and there. You can use the -framedrop option like this:
[rechosen@localhost ~]$ mplayer -framedrop
Also, when trying to play MP3 or OGG Vorbis files, you might (on really slow systems) experience buffer underruns, spoiling your music experience. In that case, try using the libmad (in the case of an MP3) or the Tremor (in case of an OGG Vorbis) audio codec. You can detect whether you have a one or not like this:
(In case of MP3)
[rechosen@localhost ~]$ mplayer -ac help | grep mad If the above command returns a line like this:
mad libmad working libMAD MPEG layer 1-2-3 [libmad] Then you can play an MP3 file with libmad, which uses a lot less CPU power. To do so, invoke MPlayer like this:
[rechosen@localhost ~]$ mplayer -ac mad
[rechosen@localhost ~]$ mplayer -ac help | grep tremor
Sadly, I don't have an example of what it should look like. If you seem to have a working tremor decoder, please leave a comment here so I can add it.
Playing streams from the internet
Many web radio stations make you download a playlist with different ip's and ports if you want to listen to them. MPlayer is perfectly able to play a web station stream, but the playlist is not a stream, nor a media file. If MPlayer doesn't autodetect that it's looking at a playlist and not at a direct stream or media file, you can try using the -playlist option:
[rechosen@localhost ~]$ mplayer -playlist
[rechosen@localhost ~]$ mplayer -cache 8192 -playlist
[rechosen@localhost ~]$ mplayer -cache 8192 -cache-min 50 -playlist
You can seek in a cache, but do not expect too much of it =).
Looping playback
If you want the media file you're playing to loop a certain amount of times (or infinitely), you can specify the -loop option, like this:
[rechosen@localhost ~]$ mplayer -loop 3
[rechosen@localhost ~]$ mplayer -loop 0
The above command will repeat playing
Altering the playback speed
This may not be that useful, but it can be good for a laugh =). You can make MPlayer play a media file at a different speed with the -speed option. The value 1.0 means normal speed, 0.5 means twice as slow, 2.0 means twice as fast and so on. Specify the option like this:
[rechosen@localhost ~]$ mplayer -speed 2.0
Altering the sample rate
You might want to alter the output sample rate sometimes (certain audio cards, for example, do not support other samplerates than, say, 48000 Hz). This is done with the -srate option, like this:
[rechosen@localhost ~]$ mplayer -srate 48000
This can also be useful when exporting audio to a file (see next chapter).
Exporting the audio to a wav file
You can export the audio of a video file to a wav file this way (note that you can also use this to convert an audio file to a wav file):
[rechosen@localhost ~]$ mplayer -ao pcm
[rechosen@localhost ~]$ mplayer -ao pcm:file=
Watching a movie in ASCII
Another pretty useless but funny feature. There are two libraries that provide support for this: aa and caca. With libaa, you can only watch a movie in black & white ASCII, while libcaca supports colors. However, libaa is more widely supported. You can watch a movie with libaa this way:
[rechosen@localhost ~]$ mplayer -vo aa
[rechosen@localhost ~]$ mplayer -vo caca
Exporting a movie to a lot of pictures
MPlayer can also export a movie to a load of images. For example:
[rechosen@localhost ~]$ mplayer -vo jpeg
Warning: the above command will output a huge amount of jpeg files. I strongly recommend to do this in a freshly made, empty directory created for this purpose.
The filenames of the jpeg file it will export will look like this: 00000001.jpg 00000002.jpg 00000003.jpg And so on... You can export to some other formats. Just replace jpeg in the command above with ppm, png or tga. Note that all these image format have their own options, too. Look for them in MPlayer's man page.
Specifying an aspect ratio
When playing video files on, for example, a wide laptop screen, you'll probably want to benefit from that wideness by watching a movie in a 16:9 aspect ratio. You can do that this way:
[rechosen@localhost ~]$ mplayer -aspect 16:9
Of course, you can also specify 4:3 as the ratio to force MPlayer to show the movie in non widescreen format.
Putting options in your MPlayer config file
MPlayer has a nice way of storing options so they will be automatically set every time you invoke the MPlayer command. This can be useful if your system, for example, always needs the audio outputted with a different samplerate. However, the syntax of the config file is a little different. If you'd type -srate 48000 on the command-line, this should be specified in the config file as srate=48000. More complex options, like the -ao pcm:file=
MPlayer config file
srate=48000 ao="pcm:file=dumpedaudio.wav"
Posted in linux
08 Oct 2007
Source: http://linuxproblem.org/art_9.html
Your aim
You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user b to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script. How to do it
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase: a@A:~> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/a/.ssh/id_rsa): Created directory '/home/a/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/a/.ssh/id_rsa. Your public key has been saved in /home/a/.ssh/id_rsa.pub. The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine): a@A:~> ssh b@localhost mkdir -p .ssh b@localhost's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time: a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys' b@B's password:
From now on you can log into B as b from A as a without password: a@A:~> ssh b@B hostname B
Posted in linux
01 Oct 2007
tar xvf some.tgz –no-anchored some.txt
When some.txt is in /some/dir/some.txt, some.txt gets extracted right there.
Posted in linux
13 Sep 2007
http://joen.dk/wordpress/?p=34
$ scpresume="rsync --partial --progress --rsh=ssh"
$ scpresume myFile remoteMachine:dirToPutIn/
Posted in linux
13 Sep 2007
http://www.ukuug.org/events/linux2003/papers/bash_tips/
Specify this in .bashrc
Make Bash append rather than overwrite the history on disk:
shopt -s histappend
Whenever displaying the prompt, write the previous line to disk:
PROMPT_COMMAND='history -a'
A new shell gets the history lines from all previous shells.
Posted in linux
13 Sep 2007