DAtum

Entrepreneurship, Software and the business of technology

apt-get through a http proxy

God – this bugged me no end at my workplace. Especially the interplay of sudo, loading environment variables, etc. with http proxy.

Rule of thumb is – sudo (if present) should be the first command, http_proxy (if present) should be the second and then the rest of the actual command

Effectively, it is something like

sudo http_proxy=http://1.1.1.1:80 apt-get update

 

 

Goodbye Python….

Your package management still sucks…. and languages like Clojure have set the bar that a modern language needs built in package and dependency management.

Lets not even talk about Ruby and Gems here.

Or lets – because I’m a Ruby man now. Plus Rails has no peer for a complete workflow (including asset management and schema versioning) – I’ve looked. And Python’s flask is just a Sinatra wannabe.

I will now relearn ruby to do my daily small hack jobs in it.

Timestamp quickies

To get the current timestamp on your linux machine  (oddly has some problem on my customized zsh shell. works fine on bash)

date +%s

To convert timestamp to date format on your linux machine

date -d @<timestamp>

Date to timestamp is

date -d “Dec 21, 2011 22:00:01″ +%s

and for heaven’s sake when you are using UNIX_TIMESTAMP() function in mysql, please take care about your TZ difference between your OS and mysql.

Monitoring hardware RAID at a dedicated hosting provider (Hivelocity??) … and avoiding nasty surprises

Hivelocity has been quite a good host for us for a coupla years now – but today a friend of mine, who owned a 500$ Hivelocity RAID 1+0 server permanently lost his data completely, I had to really try and figure out what happened.

I suddenly figured that I had no scripts to really monitor my hardware raid. After a lot of googling, I came upon a couple of tidbits, that could help others.

Figuring out what controller you have

I took a lot of help from this script here to figure out which RAID card I have. In general it could be

  1. 3Ware SATA RAID –  lsmod|grep 3w-xxxx or lsmod|grep 3w_xxxx
  2. LSI Megaraid - lsmod|grep -w megaraid
  3. LSI Megaraid SAS - lsmod | grep megaraid_sas

Since, I have a LSI Megaraid card on my server, I will be writing about Megaraid … and its tools – Megacli

Installing MegaCli

(This step took me a while to locate) Add the following lines to your /etc/apt/sources.list 

deb http://hwraid.le-vert.net/ubuntu lucid main

run sudo apt-get update && sudo apt-get install megacli

MegaCli is now installed. The command I use to get the fastest piece of info is

sudo megacli -AdpAllInfo -aAll -NoLog | grep -A 6 “Virtual Drives”

You get the following pieces of information

Virtual Drives    : 1
  Degraded        : 0
  Offline         : 0
Physical Devices  : 3
  Disks           : 2
  Critical Disks  : 0
  Failed Disks    : 0

Thats good enough for a quick monitor – add that into your crontab and you’re good to go. A good readymade script is here.

RAID battery issues

As I read in this blog post, there are issues with LSI Megaraid controllers (usually in Dell servers), where the RAID battery state is using its heuristics to learn about RAID behavior .. especially after a reboot.

Generate an event-log-since-last-reboot using megacli -AdpEventLog -GetSinceReboot -f events.log -aALL

Grep for the keyword changing. The reason why this flags is an issue because RAID controllers try to autolearn the battery charge. Double check your autolearn mode by megacli -AdpBbuCmd -GetBbuStatus -a0

# echo “autoLearnMode=1″ > tmp.txt
# megacli -AdpBbuCmd -SetBbuProperties -f tmp.txt -a0

Please run the autolearn cycle manually by megacli -AdpBbuCmd -BbuLearn -a0

 

Easier said than done #1

Q. Why cant I build an open-source version of Skype using SIP ?

A. From http://linux.slashdot.org/comments.pl?sid=2170464&cid=36186778

SIP is just one part of a rather large tool box needed to build an internet phone. SIP is actually a small part – the bit that handles the negotiation between the two ends over how to send the voice. It does not send actually send the voice – it leaves that job to another protocol, RTP. It doesn’t even negotiate the codec – SDP does that. It does not resolve domain names – DNS does that. It does not pierce NAT – STUN does that. It does not do auto-configuration, but any number of SIP based phones out that can pull down their configuration information from a URL. Blaming SIP for not doing these things is like blaming a car engine for not coming with a fuel tank. You are blaming the wrong thing. Blame the person who designed the phone that uses SIP for not providing those things. Don’t blame SIP. It has nothing to do with SIP.

Q. Why must I use Gmail – what is a good alternative to Gmail with all its features (cool UI, spam, deliverability, etc)

A. From http://ask.slashdot.org/comments.pl?sid=2368584&cid=37014742

BIND, Postfix+Postgrey, DNSBLs, Spamassassin, ClamAV, SPF, Cyrus, Roundcube, and Nagios monitoring everything. Every now and then I get someone panicking because he hasn’t got mail for 4 hours, and every now and then I have to investigate where a specific mail went wrong. Every 2 years or so I rebuild the systems on a newer distro and in the mean time I apply updates as needed. I have learn/spam and learn/ham folders that all users can dump spam and ham in and spamassassin is trained from those. It is work to look after these things

KDE4 sucks because the dev community thinks there is no money in it

I’ll be honest – this post was triggered by Linus Torvalds’ statement about Gnome 3 sucking (hallelujah!). And where does he migrate to ? XFCE4 .

Not KDE.

XFCE does not have all the nuts and bolts of other full blown desktop environments (Gnome and KDE) – yet the move is from Gnome to XFCE and not to KDE. Why is this you wonder ? Simple – KDE developers think that the environment is a playground for them to scratch their itch because, well… there’s no money in it anyway.

So they go crazy with useless shit like Nepomuk, Akonadi, Strigi and all that shit. Here’s a thought – Linus is someone with a normal workload that exceeds most of everyone else’s. If he doesnt need the semantic desktop crap, well neither do I – and neither do millions of users out there.

What we need (and are willing to pay for) is a fast, slim desktop environment with usable  network-manager, printing interfaces, scanners, multiple monitors (that is such a BIG, BIG necessity in the workplace), webcam and one… just one of the freaking browsers that I can use (Firefox or Chrome).

So why does no one in KDE work on this stuff ? Because they dont think it matters from a financial point  of view – and I dont blame them. All the polishing in Gnome is funded by the Ubuntu and Fedora projects who put in a lot of resources to get useful stuff working. No one does that for KDE (atleast not in any significant way as compared to Gnome).

However, there are thousands of people out there like me who will put in money (through Kickstarter or something) for a usable KDE desktop.

Oh and while you are at it – please hire a professional UI designer and get rid of the awful looking theme.

John Carmack talks about pocket Crysis – goodbye Nintendo

http://www.industrygamers.com/news/john-carmack-unquestionable-that-mobile-will-surpass-current-consoles/

oh yeah – this is my favorite topic. I have written about it so many times that I am practically salivating.

My current MyTouch 4G will undergo an upgrade when something like the nVidia Kal -El is able to run PS3 equivalent graphics (through an HDMI cable) on my full HD TV.

The surprising thing is – of the triumvirate of gaming consoles (Microsoft, Sony and Nintendo), only Nintendo doesnt have a mobile play.

Big, big mistake…

How to reset your Android bluetooth settings without factory reset

so my bluetooth was acting all wonky – and I really, really did not want to do a factory reset of my phone. My android was not pairing, or pairing and not connecting, etc. etc.

So what do I do ?

I fire up my good ole terminal on my android handset and do

“rm -rf /data/misc/bluetoothd/*”

Reboot and all bluetooth settings are reset.

Awesome!

Does your “sudo ” hang on Centos/Fedora/RHEL ? mine does too

Warning: this is for google to index this and help out other poor hapless souls.

If your sudo adduser/passwd/vim , etc. are hanging on any of the Redhat distro variants – its because of this not-a-bug. Apparently, Redhat does a DNS lookup whenever you do a sudo.

This usually happens when you change the hostname incorrectly. The way to fix it is to fix  your /etc/sysconfig/network

The correct version looks like this

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=myname

Moving from Java to … the JVM ?

interesting thought – from this video

The story that @fogus describes is quite interesting – how to introduce new programming language paradigms to the enterprise ? The problem that I have faced is usually in describing the value proposition – increased productivity is, sadly, not a convincing argument. I empathize with the client though because if a large services player naysays the productivity gains of, say, Ruby on Rails …. its difficult for a CIO to refuse.

But the interesting thing about this video is the way Type Aliases and Traits are able to able to do away without dependency injection - which is a big timesink in Java.

And the other – duck typing avoids the need for interfaces (http://www.kirit.com/Thread:/1720512).

interesting.

Follow

Get every new post delivered to your Inbox.