Sunday, May 4, 2008

Useful find and replace stuff


Find files containing text:



grep -i -n 'foo' *

Find files containing text and replace them with something else:



sed -i 's/foo/bar/g' *

Thursday, April 24, 2008

Ubuntu Kiosk + Opera = FTW!

Recently I've been tasked by the company that I work with to create kiosk terminals. We had some old Dell's lying around, they have a 400mhz processor, 128mb ram, 10gb hard drive. They would basically just show the company website but prevent them from going anywhere else.

Now I thought this would be a good chance to show them Ubuntu and Firefox, I'm an evangelist for those two. However what happens next is a trip into the twilight zone, I ended up having to use Opera.

It seems there are no good firefox extension that turns it into a kiosk, I tried searching on its add-on database. While there are some, most of them only works in Windoze!!! WTF!!! Mozilla wtf!!!! Open Source, ever heard of it???

Damn I was so pissed off, add the fact that the wireless usb adapters are a pain to configure in Ubuntu. I started to think that maybe I'm going on the wrong path. After googling for a miracle I finally found one post in a forum suggesting why not try opera... I've used opera before, in fact before Firefox I was a huge opera fan.

Sure enough, damn it was so easy with Opera, opera -kioskmode -nomenu -nosysmenu etc.
http://www.opera.com/support/mastering/kiosk/

Check that link for the full list of options, everything worked so sweet in opera and it was fast too. I finished all the kiosk stations in a day, and wasted 2-3 days trying to get firefox to work.

To sum it up, I installed Ubuntu using the server iso. Create a kiosk user with limited system access. Then installed xorg, xscreensaver, opera, msttcorefonts. Got the wireless adapters working using wpa_supplicant and ndiswrapper.

I created a script to start X and then when opera closes it will logout the user, this script is then called from .bashrc

kiosk.sh

#! /bin/bash
startx
clear
exit


.xinitrc
xscreensaver &
exec opera -kioskmode -noexit -nomenu -nosysmenu etc...


Removed the other terminals and left 2 running, didn't have any graphical login manager, and didn't need any window manager. They run fast and sweet on those old Dell suckers, I bet they are thankful that I saved them from the junkyard.

As for firefox, I'm so disappointed... really I am!

This post from ubuntuforums helped me install programs when the ubuntu servers were being leeched to death after the release of 8.04 it was posted by izut.

Re: How to Create Local Repository on Hard Disk

I'll describe a few steps I made to construct my personal repository. My current setup is:

- Ubuntu 'Warty' installed with Internet access (at work)
- Ubuntu 'Warty' installed without Internet access (at home)

Using the usual Ubuntu repositories, I updated the system and installed some packages I wanted (ruby, apache, mysql, etc). You don't need to install that on the host system, just use the apt-get's download only option. All files downloaded from repositories are in the /var/cache/apt/archives directory in the host system. I did these steps:

1. Created /opt/repo directory (could be the home directory)
2. Created the directory /opt/repo/binary (copied from Debian specs)
3. Copied all debs from my update from /var/cache/apt/archives to /opt/repo/binary
4. Executed dpkg-scanpackages like this:
# pwd
/opt/repo
# dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
5. Burned a CD with its contents

For use that in my standalone host, I did this:
# apt-cdrom add
...

I think it's all.

Cya.

Tuesday, April 22, 2008

SG is down!

Server went kaputz! Will be back soon.

Microsoft Predicted to Back Away from Vista - GigaOM
Just recently bought a tablet pc and I just want to slam it on the wall and rip it into pieces, the cause of my woes... Vista! It's slow as fuck... copying a single 700mb took forever, my media server (500mhz pentium II running ubuntu beat it!) It also drained the battery by doing system restore every couple of fucking minute! Had to turn it off as it was trashing the hard drive.

HP's wireless assistant is also crap, in fact HP installed so much crap on it, its annoying. My wife hated it, each time she'd restart or resume from sleep the damn thing can't find the wireless!!! The tablet I'm talking about by the way is the HP Pavilion TX1410US.

http://www.amazon.com/Pavilion-TX1410US-Laptop-Processor-Premium/dp/B0010S2P9A


This thing also runs hot, I should have probably sticked with my instinct and bought a Core2Duo laptop. In fact I'm gonna return the damn thing and get me a Core2Duo, AMD has been doing a lot of sucking lately. And its not light either, the touchscreen is annoying, it has some sort of matte that makes the screen wobble when you move from side to side.

The touchscreen is not so great, I have a wacom tablet and this thing is no wacom. I think I'll stick to my wacom for my graphic needs.

Vista = Crap piece of shit
HP TX1410US = 3 of 10 ( too fucking hot, literally will burn your lap)




Saturday, April 5, 2008

Firefox 3 Beta 5



Firefox web browser | International versions: Get Firefox in your language
Firefox 3 Beta 5, is now out, but you should probably wait before updating to the newest release. Cause this one breaks a lot of plugins and not even the lifehacker hack can enable them. Adblock appears on the toolbar but is completely worthless, it DOES NOT work!!!

Fix it!!!!Fix it!!!! Fix it!!!! Fix it!!!! Fix it!!!! Fix it!!!! NOW!!!

Monday, March 31, 2008

Dumb thief gets caught by online community



1991 skyline gt-r-stolen! calgary, ab - cash reward*pics of criminals inside* - Beyond.ca - Car Forums
-New member regretfully posts that his car has been stolen by someone with a fake ID that took a permanent test drive. Describes vehicle and thief.
-Thief encounters another forum member at Chinook mall, member recognizes stolen vehicle as described in this post. Snaps pictures, posts on beyond. Even in a city of 1 million people, thief is spotted within hours due to internet exposure
-Thief is found on facebook using said pictures, recognized by multiple members
-Full name, address, and workplace is found via facebook
-Multiple forum members drive to known address at 2:30am, car is parked outside. Dude peeks out the window, sees posse, gets scared.
-Car disappears at some point.
-Another member drives by later, finds car. Boxes car in, calls cops, calls rightful owner
-Hilarity ensues
-Cops show up 2 hours later, pictures and youtube video posted of stolen car, and Dr. Claw the fail car thief getting arrested
-Car is now safe at home, back up for sale, with a new test drive policy. Bonus: Thief leaves $22 in change, and a shitty wanksta hat.

Link is passed around to virtually every forum worldwide within hours, checking in to show community support. Appears on front page of digg.com.



Dumb thief LOL serves you right motherfucker!



Saturday, March 29, 2008

Creative sucks!!!



Message to Daniel_K - Sound Blaster - Creative Labs
Daniel_K: We are aware that you have been assisting owners of our Creative sound cards for some time now, by providing unofficial driver packages for Vista that deliver more of the original functionality that was found in the equivalent XP packages for those sound cards. In principle we don't have a problem with you helping users in this way, so long as they understand that any driver packages you supply are not supported by Creative. Where we do have a problem is when technology and IP owned by Creative or other companies that Creative has licensed from, are made to run on other products for which they are not intended. We took action to remove your thread because, like you, Creative and its technology partners think it is only fair to be compensated for goods and services. The difference in this case is that we own the rights to the materials that you are distributing. By enabling our technology and IP to run on sound cards for which it was not originally offered or intended, you are in effect, stealing our goods. When you solicit donations for providing packages like this, you are profiting from something that you do not own. If we choose to develop and provide host-based processing features with certain sound cards and not others, that is a business decision that only we have the right to make. Although you say you have discontinued your practice of distributing unauthorized software packages for Creative sound cards we have seen evidence of them elsewhere along with donation requests from you. We also note in a recent post of yours on these forums, that you appear to be contemplating the release of further packages. To be clear, we are asking you to respect our legal rights in this matter and cease all further unauthorized distribution of our technology and IP. In addition we request that you observe our forum rules and respect our right to enforce those rules. If you are in any doubt as to what we would consider unacceptable then please request clarification through one of our forum moderators before posting. Phil O'Shaughnessy VP Corporate Communications Creative Labs Inc. Forum Moderator Creative Labs
Used to liked Creative, but I guess now I would be staying away from them and actually I would refrain from ever recommending their products ever again, to anyone!!! What's sad about this is that them admitting that they knew the devices would have worked on vista but decided not to make it work, but instead sell something that would make it work. But here is this guy who made it work for free, some are saying he shouldn't take donations, well fuck them, everyone has to eat!

Also some of the forum members suggested he get hired, but I bet creative already got the programmers who can make those drivers but were told not to make them as it would drive their customers to buy newer products, Creative can suck dick, never will buy their products again.