Web Vulture

October 13, 2009

! [rejected] master -> master (non-fast forward) – Git

Filed under: git — Tags: , , — zubin mehta @ 12:45 pm

[zubin@zubin-desktop]$ git push -v master
Pushing to git@github.com:/path/to/git/repo.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to ‘git@github.com:/path/to/git/repo.git’

As a git noob, you will see this for sure. It can easily taken care of. Recall, the reason of usage of git? yes, version control, so before trying to push, do pull, because probably tour local copy is outdated.

Solution:

[zubin@zubin-desktop]$ git pull <remote add name> master

And then do changes and push. Keep an habit of always pulling before you start coding the day’s work and then push. Some organization will help!

October 12, 2009

msttcorefonts removal

Filed under: linux, ubuntu — Tags: , , , , — zubin mehta @ 8:16 pm

Installing msttcorefonts never happened instead it created lots of troubles for me. It just never let me silently update, upgrade, install using APT

[zubin@mordor ~]$  sudo dpkg –purge msttcorefonts
(Reading database … 147255 files and directories currently installed.)
Removing msttcorefonts …
W: /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Arial.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf: not registered.
W: /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf: not registered.
and many more…

dpkg: error processing msttcorefonts (–purge):
subprocess pre-removal script returned error exit status 1

These fonts were provided by Microsoft “in the interest of cross-
platform compatibility”.  This is no longer the case, but they are
still available from third parties.

–11:15:26–  http://surfnet.dl.sourceforge.net/sourceforge/corefonts/andale32.exe
=> `./andale32.exe’
Connecting to 10.200.13.50:80… connected.
Proxy request sent, awaiting response… 407 Proxy Authentication Required
11:15:26 ERROR 407: Proxy Authentication Required.

–11:15:26– http://superb-east.dl.sourceforge.net/sourceforge/corefonts/andale32.exe
=> `./andale32.exe’
Connecting to 10.200.13.50:80… connected.
Proxy request sent, awaiting response… 407 Proxy Authentication Required
11:13:00 ERROR 407: Proxy Authentication Required.

similar errors… you just cannot do apt stuff without doing something about this.

andale32.exe: No such file or directory
All done, errors in processing 1 file(s)
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
msttcorefonts

Solution:

The best way out of this annoying trouble is to remove these packages completely from the system which won’t get installed neither get removed

[zubin@mordor ~]$  sudo vi /var/lib/dpkg/info/msttcorefonts.prerm

remove or comment the defoma-font purge -all line :)

[zubin@mordor ~]$  sudo dpkg –purge msttcorefonts
(Reading database … 147255 files and directories currently installed.)
Removing msttcorefonts …
Purging configuration files for msttcorefonts …

[zubin@mordor ~]$  remove msttcorefonts
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package msttcorefonts is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

[zubin@mordor ~]$ :) :)

Vimperator

Filed under: firefox, vim — Tags: , , , , , — zubin mehta @ 12:04 am

2 days back I was face to face with awesomeness! I came across vimperator It is a vim-inspired Firefox extension designed to provide a more efficient user interface for keyboard-fluent users.

Here is the official project webpage link

Vimperator listens to his master – You can write scripts and plugins to help yourself and vimperator will act matured. Also it is highly configurable and you can change almost anything
http://vimperator.org/trac/wiki/Vimperator/Scripts

A quick start tutorial – which will help you get started!

Enjoy!

July 18, 2009

Tweet using bash!

Filed under: bash, linux, twitter — Tags: , , , , — zubin mehta @ 10:32 am

#!/bin/bash
# Store this file with whatever the name in /usr/local/bin/
# SYNTAX: twit Your_message_here
###### You cannot twit nothing! ####################
if [ -z "$1" ]
then
echo “Dude, enter some message, it can’t be blank! Come on!”
exit
fi
message=”$@”
####### Check the length to stop the request from failing #######
max_length=”140″
length=”${#message}”
echo “Message: ” $message
#echo $length
if [ $length -gt $max_length ]
then
echo “Dude, bada lamba message hai, only 140 chars allowed at a time…..It is a microblogging website, yes they are having shortage of space”
exit
fi
########## Enter your username password ##############
username=”username”
password=”password”
url=”http://twitter.com/statuses/update.xml”
curl –basic –user $username:$password –data status=”$message” $url

I wrote this small script which lets you twit through your terminal
Yes $HTTP_PROXY needs to be set

Enter your username and password in the file
and your are done!

PS: Yeah I know many such scripts exist! I never said this is new, its just new for me :)

June 10, 2009

Ubuntu fun stuff!

Filed under: ubuntu — Tags: , , , , — zubin mehta @ 9:49 am

Some stuff I stumbled upon in the past few days. It may seem lame but anyway try it out! :D

  1. Xjokes: These are some graphic jokes as the name is quite clear.
    sudo apt-get install xjokes
    After installation, type the following one by one at the terminal!
    blackhole
    yasiti
    mori1
    mori2
  2. Free the fish: Hit ALT + F2. This will open the run dialog box. type: free the fishLook at the cute thing on your screen. Well its good for sometime but after a while it really annoys! “Unfreeing” the free fish is not so obvious or may be i don’t know how to! Type this at the terminal ->
    killall gnome-panel
  3. gegls from outer space Same thing run this in run box.
    gegls from outer space
    and play the game. Also please comment back iof you ever complete the level 1. :P I don’t think anyone can finish the game.

June 9, 2009

FLash AMD64 ubuntu! phew!

Filed under: ubuntu — Tags: , , — zubin mehta @ 11:37 am

After solving the graphic card problem I had (did not quite solve it! it just worked…go by the book and restart :P ) I thought of making flash work in ubuntu. All the standard ones u’d probably apt-get wont make youtube videos work. Finally, I do what all ubuntu users would hate to do…yeah get the .deb and make install it. But adobe.com does not provide flash support for AMD 64 systems which was really sad. So the only way out was using nspluginwrapper on the flash core packages –>
http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz

I found a web-page which has a script written to do it all. But as it says you will need getlibs before you get lucky –> http://meandubuntu.wordpress.com/2008/08/20/flash-10-rc-on-ubuntu-amd64/

Awesome script :) Videos and flash works! Things are good.

March 2, 2009

mysql #1064

Filed under: mysql — Tags: , , , , — zubin mehta @ 9:55 pm

Today evening I was as usual coding something and the code which I had written had ->
$q1="INSERT into table_name(name,time,desc) VALUES('$name','$time','$desc')";

The code just refused to do what it was supposed to. Yeah you might have figured that out.
Some learnings from this were – First thing you should do when things don’t work in mysql is echo the query and try running it in phpmyadmin or at the prompt!
I have been using mysql for like 1.1/2 years now and I come across this outlandish error. Almost eccentric and I tried looking at he code again and again to check if i misspelt something or missed a comma, whatever….Good that there weren’t any mistakes there, bad it took too much time. I slept for 2 hours very frustrated !! Then I went to phpmyadmin. and there I see the “ERROR” – #1064

At once googled and there I see the answer to my problems – reserved words.
Mysql has reserved words ! Some words cannot be used as identifiers directly and to use them all we need to do is quote them.
i.e.
Query: INSERT into table_name(name,`time`) VALUES('abcd','23443545')
The identifier quote character is the backtick (“`”). TIME is a reserved word. Check out Schema object names

huh…another life’s problem solved!

January 1, 2009

Digg uprising for dummies

Filed under: digg — Tags: , , , , — zubin mehta @ 9:23 pm

So here, we come across another internet or rather digg revolution/uprising whatever! This is I think happening for the 3rd or 4th time (not sure) and infact the only so called internet revolutions or so to say “Symphony of the crowds” I have seen were on Digg. Never on any other portal have i seen such integrity.
So whats the whole revolt about? Its about the existence of power users. Power users are the one who are known for bartering diggs. They be your fan like that of thousand others and then choose some articles either from the internet or some which weren’t lucky enough to get even 2-3 diggs! and submit them to digg and then ask all friends, their network or barter it to get it dugg to get it on the front page, which a normal user can only dream of! These power users are known to digg like 300 articles/hour(all bartered!) and for sure they are all fake; can u read 300 articles/hour!! I bet you cannot even 10.
Haha!
Definitely, these power users have no love for content. They don’t care. So why do they do all this? Well, fame and maybe they are running online marketing portals and probably excelling at it, who knows!
So its only the power users who mostly get content on the first page which is mostly the only page viewed by thousands. Hence, the top content that we read is not exactly what needs to be at the top but some manipulated article put there by dirty means. After getting the initial kick by friends and bartering, the rest work is done by the very normal users who digg most decent articles they come across. And thats it, job done! bingo!
Most digg users now feel a need to reinvent the wheel, tweak the way digg works for it to follow democracy and not any other model which it has turned into. No matter, Digg is a wonderful website very well managed, things are now getting serious. I hope some measures are taken by the Digg staff!

December 29, 2008

Subqueries

Filed under: mysql — Tags: — zubin mehta @ 9:36 am

Today was the first time I came across the need for SELECT’s within SELECT in mysql. Actually never done much of non-trivial coding in mysql! Also i came up with the most-probable syntax of such a thing if it existed. Then I immediately asked a friend and he said it exists and very much the same syntax(kind of obvious) He said its called nested queries rather subqueries and then i discovered that the early need for such nested loops was to make the language more intuitive and less confusing and hence the name “Structured Query Language” (SQL). Just imagine if you have 10 tables and u have one single connector in two consecutive tables, and suppose you need information from tb10 using tb1 info; it would be a really bad way of coding by writing 10 separate queries and pipe the outputs at ecery single stage but instead use a lot more better way by writing just one query and go ahead..Smart and obvious!

November 28, 2008

Ubuntu lost password!

Filed under: ubuntu — Tags: , , , , , — zubin mehta @ 12:20 pm

This is one sad thing you come across after may be realising that you badly need linux for some work which is impossible in windows(believe me there are some such things…) So you realise that you do have linux installed(you were feeling all geeky some time in your past) At once you restart your computer and switch to linux. Then they ask you for the username and password! Most probably your username is your name but as i said you were feeling geeky when installing it long ago you have definitely kept some not-to-be-known-super-nerdy-password huh..!

Now you don’t remember it! Unlike other OS, no hint questions, but only an adamant screen asking the same question and wont let you proceed. Realize that passwords should be always from some of your standard known ones (or rather md5() of your name or md5 of “your_name;” – quite geeky and no need to remember;)

Steps to do:

  1. Restart your computer
  2. When you reach your grub press ‘ESC’ then press ‘e’ to enter the edit mode
  3. Go to your ubuntu kernel line and press ‘e’
  4. go to the end of line and add -> rw init=/bin/bash
  5. Press enter
  6. press ‘b’ to boot
  7. Now as it boots it will lead you to the full access root terminal, obviously as root
  8. at the prompt type passwd username and it will ask for a new unix password, set it and done
  9. Suppose you do not know the username, then type -> passwd -a -S which will list all the users and from there you can check it out!
  10. Restart your computer and login with new password

Now that you have done so much to get into linux again, please do something productive there and stay there for some time…it isnt for geeks but for work!

PS: rm -rf  – whoever you are, whatever you do, please please do not try this at home or at workplace!

PPS: An easier way out – http://www.psychocats.net/ubuntu/resetpassword courtesy – A.Y. Siu, see comments

Older Posts »

Blog at WordPress.com.