Setting locale failed error on Ubuntu or Debian
Posted: October 13, 2009 Filed under: NEZzen Leave a comment »Sometimes I get a weird error message when using apt-get or dpkg on certain Ubuntu or Debian systems. More particularly, this happened on a server I was running and confused me quite a bit. Basically, when working with packages, I kept getting the following message:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
After some research online, I found the quickest was to fix this was to run (as root):
apt-get install language-pack-en-base
I was also told to execute the following, but I found it to be unnecessary:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
I hope this helps someone else, too. Remember to change en_US to your desired locale.
Slashdot Comment: Architecture Astronauts
Posted: September 25, 2009 Filed under: NEZzen Leave a comment »I don’t think this guy ever worked with any software engineer with any significant amount of experience. Or maybe he just works with people that suck as software engineer.
The typical evolution towards wisdom in Software Engineering goes like this (simplified):
Command Line Interface (CLI) Shortcut Keys
Posted: August 24, 2009 Filed under: NEZzen Leave a comment »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 |
Quotes from Slashdot
Posted: July 29, 2009 Filed under: NEZzen Leave a comment »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)
The Hidden Character
Posted: July 5, 2009 Filed under: NEZzen Leave a comment »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.
DisplayLink on Router
Posted: June 1, 2009 Filed under: NEZzen Leave a comment »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.
Some Amazing Quotes I Read About War
Posted: May 29, 2009 Filed under: NEZzen Leave a comment »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
iEverything: a satire
Posted: March 17, 2009 Filed under: NEZzen 1 Comment »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 »
Randomly Sort an Array in Java
Posted: February 28, 2009 Filed under: NEZzen Leave a comment »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.
Reverse Lines in File
Posted: December 10, 2008 Filed under: NEZzen Leave a comment »This bit of code will reverse (not flip) all the lines of a file, starting with the last line.
perl -e 'print reverse <>' < input > output
For example if your file is
a b c
this will convert it to
c b a