August 24, 2009 by Brian
Here’s a great list of command-line shortcuts you can use in a Linux terminal, thanks to MakeUseOf.
| Ctrl-a |
Move to the start of the line. |
| Ctrl-e |
Move to the end of the line. |
| Alt-] x |
Moves the cursor forward to the next occurrence of x. |
| Alt-Ctrl-] x |
Moves the cursor backwards to the previous occurrence of x. |
| Ctrl-u |
Delete from the cursor to the beginning of the line. |
| Ctrl-k |
Delete from the cursor to the end of the line. |
| Ctrl-w |
Delete from the cursor to the start of the word. |
| Ctrl-y |
Pastes text from the clipboard. |
| Ctrl-l |
Clear the screen leaving the current line at the top of the screen. |
| Ctrl-x Ctrl-u |
Undo the last changes. Ctrl-_ |
| Alt-r |
Undo all changes to the line. |
| Alt-Ctrl-e |
Expand command line. |
| Ctrl-r |
Incremental reverse search of history. |
| Alt-p |
Non-incremental reverse search of history. |
| !! |
Execute last command in history |
| !abc |
Execute last command in history beginning with abc |
| !n |
Execute nth command in history |
| ^abc^xyz |
Replace first occurrence of abc with xyz in last command and execute it |
Posted in Brian Nez's posts | Leave a Comment »
August 2, 2009 by Brian
The script converts one flac file to an mp3 file and takes the flac file as a parameter. Do not forget to quote the filename if it contains spaces. Thanks for the tip, Fredric!
#!/bin/bash
FLAC=$1
MP3="${FLAC%.flac}.mp3"
[ -r "$FLAC" ] || { echo can not read file \"$FLAC\" >&1 ; exit 1 ; } ;
metaflac --export-tags-to=- "$FLAC" | sed 's/=\(.*\)/="\1"/' >tmp.tmp
cat tmp.tmp
. ./tmp.tmp
rm tmp.tmp
flac -dc "$FLAC" | lame -b 192 -h --tt "$Title" \
--tn "$Tracknumber" \
--tg "$Genre" \
--ty "$Date" \
--ta "$Artist" \
--tl "$Album" \
--add-id3v2 \
- "$MP3"
Posted in Brian Nez's posts | Leave a Comment »
July 29, 2009 by Brian
You have a choice: you buy a product NOW, or you read the news: oh, there is a quad-GPU graphics card scheduled in 6 months. By the time it’s ready, you read again: there is another one with 64 GPU’s ready in one year. So, if your choice is to never be happy, don’t blame it on tech.
— alxtoth (914920)
The Ubuntu OS exceeds the Mac OS in Gibboniness, whereas Apple seems to have cornered the market on Leopardiness. The overall Toucaniness and Salamanderiness of the offerings is about the same.
— Kohath (38547)
Of course it’s a trap. Imagine you were walking along and you saw a bear trap on the ground, with a trip wire beside it leading to a gas canister. A cage is suspended over it by a rope, and there’s a sentry gun mounted nearby. You might think, “this is a trap”, unless you were a Novell executive, in which case you would step into the the apparatus try to find ways to “interoperate” with it.
— Experiment 626 (698257)
Read the rest of this entry »
Posted in Brian Nez's posts | Leave a Comment »
July 5, 2009 by Brian
Quite an interesting discovery I recently made: there is a hidden character code used to tell in a Unicode file which byte-order multibyte characters have. Basically the character is invisible (“zero-width and non-breaking”) to most editors, which is why it is sometimes useful for other things, such as floating an item to the top of a sorted list. The hex code of this invisible character is #FEFF or #FFFE and can be written in HTML using an escape sequence such as . Use with caution.
Posted in Brian Nez's posts | Leave a Comment »
June 30, 2009 by Brian
Posted in Brian Nez's posts | Leave a Comment »
June 1, 2009 by Brian
I was recently able to get my Kensington sd200v dock, which features a VGA DisplayLink-driven output, to work on my Asus WL500gp-v2 wireless router. I used the modified SlugTerm w/ Sven Killig’s patches.
Here’s the initialization codes for DisplayLink devices – given in hex.
640x480 = 009930269460a9ce6007b30f79ffff028083bcfffcffff01e00102ab13
800x480 = 00203c7ac9f26c48f97053ffff2127032091f3fffffff901e00102c819
800x600 = 00203c7ac99360c8c77053ffff21270320918ffffffff202580102401f
1024x768 = 003618d51060a97b33a12b2732ffff0400d99affcaffff03000403c832
1280x1024 = 0098f80d572a554d54ca0dffff944305009aa8fffffff9040004026054
Remember, you will need to use libstdcpp v4 instead of the default v3. (mirror)
Mirrored SlugTerm modifications
Picture:

Posted in Brian Nez's posts | Leave a Comment »
May 29, 2009 by Brian
Every gun that is made, every warship launched, every rocket fired signifies in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. This is not a way of life at all in any true sense. Under the clouds of war, it is humanity hanging on a cross of iron.
—Dwight D. Eisenhower (April 16, 1953)
They wrote in the old days that it is sweet and fitting to die for one’s country. But in modern war, there is nothing sweet nor fitting in your dying. You will die like a dog for no good reason.
—Ernest Hemmingway
Posted in Brian Nez's posts | Leave a Comment »
March 17, 2009 by Brian
iEverything: a satire copyright © 2009 Brian Nez, under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. Some rights reserved.
Thank you! Thank you all for coming! It is I, Steve Jobs, the Chief Imagination Officer of Apple, also known to many as Your Leader and Overlord of All Things Shiny, Desirable, and Expensive.
Today we’re going to make some history together! So…welcome to Macworld. It was just a decade ago that I was up here, announcing that we were going to revolutionize the world–a huge endeavor, I admit. I said we were going to do it over the coming twelve years–we did it in seven years. We couldn’t have done this alone; we did it with the help of a lot of folks: Our new colleagues in scientific agencies around the world, our devoted imagineers of more than just hardware and software, but of minds and vision. Thank you very much. Now as you know, our retail stores have for a while been selling half of our Apple iProducts to people who have never owned an Apple iProduct before. For this, I would like to thank our custom–err–loyal members of the Apple Family for spreading the gospel. Without you, we would still be just another average tech company based out of California. Instead, we are now one step closer to world domination through over-priced, beautifully designed, consumer electronics. Now everyone, please gaze upon me and yearn, yearn for the secrets that only I know! The rumor channels are full of speculation and I–your balding, black-turtleneck-endowed Leader–know the iTruth. Bow before me and grovel at my iFeet! (Mwahaha!)
Now please, before I continue, I would like to make sure that everyone present at this glorious ceremony is a true iBeliever. As a reminder, if you are not a true iBeliever you are not a member of our Apple Family, and as a result you will be cast out and sent into the Reality Distortion Field for re-education regarding our iProducts…
Read the rest of this entry »
Posted in Brian Nez's posts | 1 Comment »
February 28, 2009 by Brian
How to quickly, randomly sort an array in Java:
for(int i = array.length-1; i > 1 ; i--) {
randIndex = random.nextInt(i);
temp = array[i];
array[i] = array[randIndex];
array[randIndex] = temp;
}
Note: You will need to declare “randIndex” as int, “temp” as the same type as the array’s members, and “random” as new java.util.Random().
How it works: The “for” loop starts at end of array and moves towards the beginning. The variable “i” acts as a cursor separating the randomized end of the array from the un-randomized beginning of the array. The next line takes some int value representing a random space up to end of unsorted area. The value of current unsorted letter (at the cursor “i”) is then stored within “temp” and the random letter is set to the value of the current un-randomized space. Finally, the value of unsorted letter is restored to original random space.
Posted in Brian Nez's posts | Leave a Comment »
December 15, 2008 by Brian
Originally written by Dan Walrond.
Using netcat and tar to quickly transfer files between machines
So you have gigs of data to transfer between two machines over ethernet. A nice quick and dirty method is to use netcat and tar. This is by no means secure, but if you haven’t got the time or desire to setup NFS, FTPd, Samba. Or wait hours for scp to do its job then this can save you a lot of time.
Linux System using tar and netcat
On the receiving end do:
# netcat -l -p 7000 | tar x
And on the sending end do:
# tar cf - * | netcat otherhost 7000
Read the rest of this entry »
Posted in Brian Nez's posts | Leave a Comment »