So you wrote a macro in vim and you want to repeat the last macro multiple times and you don’t know how.
You type @@
Now you know how. π
So you wrote a macro in vim and you want to repeat the last macro multiple times and you don’t know how.
You type @@
Now you know how. π
Here is a bash script to create 100 random files with random sizes smaller than 400KB. I needed this to quickly generate 100 files to use it on a stress test.
for ((i=1;i<101;i++)); do
size=`expr $RANDOM % 400`
dd if=/dev/urandom of=/tmp/testfile.$i bs=1024 count=$size
done
Explanation:
The for loop is pretty straightforward, it counts from 1 to 100.
size=`expr $RANDOM % 400`
This line generates a random number between 0 – 399
dd if=/dev/urandom of=/tmp/testfile.$i bs=1024 count=$size
This line generates a file with blocksize (bs / not bullsh!t) 1024 times the random number that we generated. The input for that file is the special urandom device in linux. (It’s the random number generator for the linux kernel)
The name of the file is also straightforward.
If you need to run native Linux client for Lotus Notes 8.5 on Ubuntu 10.04:
1) After installing your ibm_lotus_notes*.deb files, drop the following files under /opt/ibm/lotus/notes
libgdk-x11-2.0.so.0
libgtk-x11-2.0.so.0
libgdk_pixbuf_xlib-2.0.so.0
libgdk_pixbuf-2.0.so.0
You can get the files here.
2) Install msttcorefonts package: sudo apt-get install msttcorefonts
3) Go to File -> Preferences and choose Windows and Themes on the left pane. For Theme, choose Operating System Theme. This way most of the fonts in the UI look much better.
First of all, setting up screensaver configurations in gnome is a total mess. I don’t know why they decided to release and use gnome-screensaver instead of using xscreensaver. And I don’t want to know either.
My ubuntu setup is an archaic one. It’s an upgrade over an upgrade over an upgrade. I probably upgraded 4 or 5 times. So my config files might be overwritten, wrongly upgraded, etc… But I was having this horrible issue of not being able to setup my glslideshow settings.
You can search this online. Mainly people are complaining about how to setup the directory from where glslideshow reads the images, also how to set it up so that it doesn’t idiotically show the same images 5 times over and over again. Well I’ll repeat these in this blog post and some more which are not covered.
First of all to setup the directory to read the images go to your home directory and create/edit file .xscreensaver like the one below:
imageDirectory: /home/username/Pictures/Slideshow/or/wherever
This sets up your screensavers that are using images, to use this directory instead ofΒ /usr/share/backgrounds (the default directory). Some people on the internet tells you to symlink it to your directory, but I think this is a far better way of doing it.
If you read the glslideshow manual (RTFM), it tells you that by default glslideshow pans an image for 6 seconds (Ken Burns/Pan Scale effect) and displays it for 30 seconds. This means that the glslideshow will idiotically display the same image 5 times. (30/6=5)
In order to fix this issue, you will need to tell it to pan it n seconds and display it also n seconds. So the command should be:
/usr/lib/xscreensaver/glslideshow -root -pan 6 -duration 6
(-root means display on the root window which is the way screensavers work)
The configuration for this resides at: /usr/share/applications/screensavers/glslideshow.desktop
Go ahead and edit that file as root and change the line that reads:
Exec=/usr/lib/xscreensaver/glslideshow -root
to
Exec=/usr/lib/xscreensaver/glslideshow -root -pan 6 -duration 6
Now you are ready to have a slideshow that displays with pan/scale each image for 6 seconds.
This is where the shit hit the fan for me. No matter what I did, my glslideshow was still running as /usr/lib/xscreensaver/glslideshow -root (ps aux | grep glslideshow)
After a stubborn and painful few hours I discovered that these settings were being cached in a file called: /usr/share/applications/desktop.en_US.utf8.cache (This is WTF number one)
If you look at this file, it’s a 56 KB cache file of all the settings gnome is reading for all of it’s applications!! I guess it should have been setup to delete it on restart but for some reason it never got deleted…
After renaming this file (never delete them, always rename them π ) the slideshow started to run as I wanted it to be.
WTF number two was that when I tried to add new images to my slideshow directory, glslideshow never picked them up. At the end of another painful search I found that the list of images are actually cached in a file called .xscreensaver-getimage.cache under /home/username/tmp/ (username is your username). I got rid of that file…
So now, it looks like I have a slideshow screensaver which kind of works. And hopefully you too…
Nokia released a 16 MB minor release for the n900. The firmware version is: 3.2010.02-8
I had some issues with the update. I basically ran out of rootfs disk space. The update application complains as: Not enough space in location. For me disabling all the extra repositories and running apt-get clean; apt-get autoremove did the trick.
This looks like a bugfix update, and might be paving the road for the PR1.2 release. Still official changelog is a mystery. For more info check this thread on talk.maemo.org.
Also the update takes another ~3 MB on your rootfs. π
This battery life situation is kinda pissing me off. π
I wrote a script to get charge, battery %, and cpu load. Made it run every 10 mins to collect the data. I unplugged the phone at 9:40 am. No 3g, no wireless, very few interaction. About 10-20 mins phone conversation. And at 15:30 the battery was completely drained. It gives me 6 hours of battery life under normal conditions.
The handset runs very warm. I found a temp sensor in the /sys folder but I don’t know if it’s telling me the truth since it’s constantly at 38ο»ΏΒ° C. I contacted the Nokia support, I hope they can provide me something. Maybe I have a defect battery.
Here are the charts since I love them… π
Background information:
All and all I’m definitely a Linux person. That means my expectations from n900 was primarily to be hackable π I’m also coming from the world of blackberry. My previous hand-held was 8320. Other than being an extremely well designed smart-phone for business and email, it was pretty much useless for me. In this review i will also try to compare them.
I actually wanted buy the new google nexus one, it turned out that being a T-mobile customer for almost ten years would actually not allow you to qualify for the discount price of $180 with a two year plan renewal. So I said phukitol, and went and spent my $500+ to a Nokia n900 instead of a Nexus One.
N900:
N900 is the flagship product of Nokia for 2009-2010. It’s running maemo as the OS. It’s the “other” linux based handheld OS currently developed only by Nokia (well apart being open source for most parts of it). It’s debian based. So ubuntu/debian users will find theirselves pretty much at home. (System wise of course. UI is completely unrelated)
It has a full qwerty (for US) keyboard. The screen slides up to reveal it. If you don’t want to use the physical keyboard, it also offers a virtual one. It’s kinda weird though because the virtual keyboard is a full screen keyboard π
It also has a great camera. Very good widescreen 800×480 resolution. It works with t-mobile 3g, which is first for me. I had a chance to test the 3g around Washington, DC and Providence, RI. I’m not very impressed. But when it really is on 3g things get super fast.
Goods:
Not So Goods:
Overall, I think this phone has a lot of potential. It sleek, very sexy and user friendly. Absolutely a great potential for linux hackers and developers. If I would have an option to return it, I probably wouldn’t. And I’m happy that I didn’t buy a Nexus One. π
Note: Wow it looks like me and engadget did a review at the same time π
I’m writing this entry to push me to finish my neverending story about the digital frame project I started. I’m hoping that the entry will give me some sort of ignition after more than a year.
I had an old Dell Latitude c600 sitting at home and collecting dust. Like many other old hardware I have at home… So I decided to convert it to a digital frame that I can hang it somewhere.
Here are my goals:
The very first step was to dissect the laptop and remove the guts. It turned out to be somewhat challenging, but with the right tools and time, things moved pretty good. I’m not going to go into details on how to dissect a c600, but here is a picture in the late stages of the dissection.
Next step was to remove all the unnecessary parts like battery, CD-ROM, and some mini pci cards like ethernet/modem combo. I kept the pcmcia slot for the wireless card, and while there, added some leftover RAM to it. After neatly placing them all together, here is how it looks with BIOS setup on. The image is tilted to get rid of the flash glare.
Now the software step. Of course my OS of choice is Debian/Linux. I installed bare minimum Debian with fluxbox as desktop manager. Al I needed to do was to find a low cpu/memory usage image viewer. At first I thought about not having a Graphic User interface, and use zgv from the console, but then I gave up since it was too much trouble. (Still I think it would be cool to have a console only picture frame, maybe on the next version)
Instead, I decided to use feh. I must say i’m extremely satisfied with feh and recommend to everybody π The only issue I had was that the mouse pointer was showing in the middle of the frame which was not a good sight. I used unclutter to get rid of that. (I had to hack the program a bit to my taste)
I wrote some scripts and changed some config files for all this to start automatically. I will share the scripts later when the whole project is completed.
Now that the computer part is done, I need to take the measurements and head home depot or similar place to create some base for the frame and also buy a nice looking frame to place everything inside. So I guess there will be a second part of the blog entry.
Here is how it looks like as of now:
I needed to see a word file on my ssh session this time… If you have a similar need try to use antiword. It basically parses the word document and sends the output as a text file to your console. Of course don`t expect it to render the graphic files in your word document π
Today I learned something new!
I had two files one with a list of domain names, the other with corresponding IPs. I needed to merge these two files to display domain names next to their corresponding IPs.
It looks like it`s the simplest task with the command paste.
All I had to do is: paste /tmp/domain_names /tmp/IPs
Thanks Igor for the tip π