July 20th, 2010
Written by: Vhati
Linux’s perl package has a command called “rename” which understands regular expressions.
Windows lacks that, of course. I’ll recreate it using sed, in a way that’s consistent across platforms…
It won’t spring to mind when you need it (unless you’re really familiar with sed), but the exercise is a decent excuse to demonstrate the oft-neglected hold buffer.
Read the rest of this entry »
Tags: Linux, OSX, Windows
Posted in App-Fu, Code | No Comments »
July 19th, 2010
Written by: Vhati
Delayed whim I followed up on this week: a fork of GNU Grub.*
Once I settled on one of the myriad riggings that clutter the docs, it was easy to set up from within Windows. No Linux necessary.
Read the rest of this entry »
Tags: Linux, Windows
Posted in RancidMeat | No Comments »
May 9th, 2010
Written by: Vhati
Edit (2010-05-20): “hl=all” no longer works. Assuming you don’t want pirate-speak (“hl=xx-pirate” which still does), I rewrote the post.
If you can’t stand the new clutter on Google, there’s a blog devoted to reverting (the Opera userjs there worked):
http://theoldgoogle.blogspot.com/
To disable suggestions, make this your homepage.
http://www.google.com/webhp?complete=0&hl=en
Posted in Linkdump, Tech | No Comments »
May 5th, 2010
Written by: Vhati
I’m stringing commands together and want to see what’s passing through a particular point. Technically tee (Linux/UnixUtils) can do this. Its sole purpose is to duplicate stdout to a file, like a metaphorical “T” connector.
echo hello | tee somefile.txt | sed "s/e/a/"
Attentive readers will be thinking,
“The post just started; what’s wrong with it?” :P
*clickety-click*… Nothing, this works:
echo hello | tee /dev/stderr | sed "s/e/a/"
*drumroll*… on Linux, where everything’s a file.
While many MinGW ports on Windows internally translate the likes of “/dev/stderr”, the UnixUtils tee does not. A hyphen arg obediently makes a file named “-”. Linux guys can keep reading; this trick is nifty.
Read the rest of this entry »
Tags: Linux, OSX, Windows
Posted in App-Fu | No Comments »
April 30th, 2010
Written by: Vhati
According to the preferences, the three sections of Wireshark are:
- Packet List – Rows of src/dest/protocol/info
- Packet Details – Collapsible tree
- Packet Bytes – Tabbed hex dumps
Most of the time, if you’re sniffing text-based traffic, you’ll find interesting packets, right-click in the list, and “Follow TCP Stream”. The problem is Wireshark’s too honest sometimes, and if the traffic is compressed, you’ll see the binary garbage that’s really flowing through the NIC.
HTTP/1.1 200 OK
Content-Encoding: gzip
If you see this HTTP header, there’s another approach.
Read the rest of this entry »
Tags: Linux, OSX, Windows
Posted in App-Fu | No Comments »
April 26th, 2010
Written by: Vhati
Occasionally I have to parse xml, which is often not grep-friendly. Luckily, there’s XMLStarlet (the actual command’s named ‘xml’) to make it relatively easy, if longwinded for a prompt. It’s in Linux repositories, and there’s a Windows version.
For this post, I’ll be referring to an example file that looks like this.
<?xml version="1.0"?>
<Cast>
<Character gender='M'>
<Name>Fry</Name>
<Job>Delivery Boy</Job>
<Species>Human</Species>
<From>
<Location>Earth</Location>
<Location>New York</Location>
<Location>Brooklyn</Location>
</From>
</Character>
…
</Cast>
1) Loop through all characters, printing the value of their name tag and a newline.
xml sel -t -m "/Cast/Character" \
-v "Name" \
-n futurama_cast.xml
# Zapp
# Leela
# Amy
# Zoidberg
# Fry
# Bender
# Professor
# Kif
Read the rest of this entry »
Tags: Linux, Windows
Posted in Code, RancidMeat | No Comments »
April 18th, 2010
Written by: Kyle
Last week’s assignment touched on something I’d like to dive into a little deeper, which is the subject of understanding people complexly. The basic idea here (despite the name of it) is quite simple. To understand people complexly is to think of them in terms of their own life and experiences, and see them through the same frame of reference in which they see themselves. In practice, this can be quite difficult (as I’m sure you already know).
You’re probably familiar with the old saying, “Put yourself in their shoes.” What does this really mean, though? To put yourself in that person’s shoes is to understand enough about them that you can recognize the reasons why they make the decisions that they do. Very few (if any) behaviors that you encounter in everyday life are completely irrational. There are reasons for everything. These reasons obviously don’t always line up to our expectations, and often don’t even line up to the person’s stated values, but they exist.
Read the rest of this entry »
Posted in Life lessons | No Comments »
April 15th, 2010
Written by: Vhati
Say you’ve got a Windows command to run over and over with a different arg each time. Wouldn’t it be nice if you could make a word list and loop over it the way bash does?
Read the rest of this entry »
Tags: Windows
Posted in Code | No Comments »
April 11th, 2010
Written by: Kyle
A while back I was having a conversation with a friend of mine, and was recounting a bad encounter I had earlier that day. The gist of it was that someone said some hurtful things to me, and it had hit me pretty hard. This wise friend of mine said something that has stuck with me since then. “When someone treats you poorly, it has at least as much to do with them as it does with you.”
The brilliance of that statement didn’t fully sink in that afternoon, as I was still in my own head and being affected by the emotions of the earlier encounter. As time went on, though, the truth of it really shone through. In future bad encounters with people, I found myself thinking more analytically about what part of it was something I had truly done, and what part was that other person taking their own problems out on me. This simple thought process saved me quite a bit of turmoil over the years, and I thought it only fitting that I share it with you.
Read the rest of this entry »
Posted in Life lessons | 1 Comment »
April 11th, 2010
Written by: Kyle
Update: this offer has ended.
I’ve always loved books. They, more than any other media, have helped to shape my view of the world. Because of that, I would like to give some other folks the opportunity to read some of my favorites. To that end, I am going on an Amazon wish list buying spree. I haven’t decided yet what my spending limit will be, but the basic plan is that you will go and create an Amazon wish list, and add one (or more) of these books to it, and then put the link in a comment here, and I will buy it. You can also feel free to suggest other books that should be in this list, though I’m not promising I’ll add them. The buying spree will go until I’ve spent as much of my tax refund as I’m willing to part with, at which point I will announce that it has ended. Questions/concerns/etc. can be voiced in the comments.
Read the rest of this entry »
Posted in Uncategorized | 1 Comment »