Monthly Archives: November 2011

1

25 worst passwords — how to change your password in Linux

by

Noob thing.

Might be interesting to find out if your password is on the list.

The top 25 worst passwords.

How do you change your password?


:~$ passwd

You will get output that looks like:

Changing password for (youruserid)
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
:~$

Wayno

1

How to label an ms dos Flash Drive or Micro SD card using mtools in Linux

by

The information on how to label an ms-dos formatted drive seems scattered across the internet, and might seem overwhelming at first. But it’s not too hard. Here’s my recipe!

1. If not already installed, install the mtools package. This is an open source package for manipulating ms-dos file systems, under Linux.

to do that simply install the package:


sudo apt-get install mtools

We’re half way there!

2. Let’s insert that flash drive, thumb drive, micro sd card or whatever it’s called.

3. Most systems should auto-mount the drive. If not, view this article, on how to mount a usb or micro-sd card.

4. We’ll use


sudo blkid

to get the device id!

$ sudo blkid
[sudo] password for :

/dev/sde1: LABEL=”” UUID=”1B44-206B” TYPE=”vfat”

That’s the guy I want! sde1! Your device WILL probably have a different device name.

5. Let’s fix /etc/mtools.conf first.

using your favourite editor (nano in my case) let’s change mtools.

as always the # (octothorpe) is a comment and need NOT be coded.


cd /etc # change to the /etc directory
sudo cp mtools.conf mtools.conf.org # make a backup of the current file
sudo nano mtools.conf # edit the mtools.conf file

add a line at the bottom which reads:


drive p: file="/dev/sde1"

control+O (OH) to write, and then control x to exit. Again, your device name, might be different.

do a

cd ~ # change back to my home directory

to get back to your home directory, after editing /etc/mtools.conf.

6. So now I try to label the drive, p: but I get:

nwayno@Homer:~$ sudo mlabel p:WAYNOFLSH
Total number of sectors (1957888) not a multiple of sectors per track (62)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test

Oh-oh! It turns out the it tells you how to fix the problem right there, but it may not be obvious. (All this to label an ms-dos drive under Linux? YES, unfortunately!)

Using your favourite editor, create .mtoolsrc (yes the period at the beginning is important!)
and add the line:

mtools_skip_check=1

to the file. Save and exit. Again, all this is not hard, it’s just a pain.

7. Let’s try again!

$ sudo mlabel p:WAYNOBKFLSH
$ df -h
Filesystem Size Used Avail Use% Mounted on

/dev/sde1 955M 203M 752M 22% /media/WAYNOBKFLSH

8. Flush the buffers with sync


sync

Mission accomplished!

Look Ma, I didn’t have to use Windows, after all!

Wayno

0

What task number is running in Linux?

by

A lot of times, I want to see what the task number is of a running task. I might want to see if there are multiple occurrences of a task, or a zombie task (defunct).

Easy way is to:

ps -ef | grep taskname

ps says give me a snapsnot of all the running tasks. The -ef says give me all the tasks, and give me a full listing. That is then piped (that is the output of ps, becomes the input to grep and we are searching for some task name.

But that get’s tiresome.

Easier way? Sure!

Add an alias to .bash_aliases!


alias thog='ps -ef | grep $1'

So use your favourite editor, add the line above, then exit.

NOTE: IN ORDER FOR CHANGES TO BE READ, YOU MUST LOGOUT/BACK IN.

So we created a command called “thog” (could be anything as long as it doesn’t conflict with any installed programme) — and I pass the command line argument $1 to it. (The first command line argument)

So the output would look like this:

nwayno@Homer:~$ thog java
root 2031 1 0 Oct28 ? 00:13:16 java -Xmx100m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=4040 -Dsubsonic.httpsPort=0 -Dsubsonic.contextPath=/ -Dsubsonic.defaultMusicFolder=/var/music -Dsubsonic.defaultPodcastFolder=/var/music/Podcast -Dsubsonic.defaultPlaylistFolder=/var/playlists -Djava.awt.headless=true -verbose:gc -jar subsonic-booter-jar-with-dependencies.jar
nwayno 28470 28430 0 21:07 pts/0 00:00:00 grep java
That shows me the java (or whatever) task number. Might be useful if you want to kill a task.

Want to see all the Zombie tasks? (tasks that have no parent task)

nwayno@Homer:~$ thog defunct
root 28843 2067 1 21:11 ? 00:00:00 [miniserv.pl]
nwayno 28852 28430 0 21:11 pts/0 00:00:00 grep defunct

So now you know.

By the way, I corrected the spelling of Adventures in the title. Taking it a bit easy this week, still healing.

enjoy,

Wayno

0

Why wifi may NOT work on an Android

by

Okay so I am new to the Android platform (as of this week). But for the life of me could NOT figure out why my wifi connection to my home network wouldn’t work.

I checked all the usual things. Signal strength, another network (thanks Jason whoever you are, for having an open unsecured network I could connect too), etc.

My friend Matt suggested this Android Application:

Wife Analyzer

Which is pretty handy for finding those other networks, channels, etc.

What I discovered however, was that I was 1 character off in my password. That’s why it would authenticate, connect, and then drop!

So having a password like: K00lJerkBe1b3r is different from:
K00lJerkBe1B3r

(It’s a song I don’t like, plus an artist I don’t like – make great passwords — please don’t use this one, even if you don’t like Justim Beiber too!

But anyway, that turned out to be my issue.

After getting the password fixed, I was then able to complete a 3.5 minute Skype call to my bud Tony in Pahonics

Thanks Matt, Tony, and Loni!

Wayno