If you can’t wait for the launch of the official #Ubuntu smartphones (the first models are supposedly due later this…

Originally shared by Linux News Here

If you can’t wait for the launch of the official smartphones (the first models are supposedly due later this year), don’t want to shell out for a new phone anyhow, or would prefer to use a different version of Linux on a portable device, there is an alternative. It’s possible to run a variety of popular distros on a standard Android smartphone or tablet – everything from a simple toolset right up to a full distribution with a desktop environment. You don’t even need to root your phone for some of the methods that we explore in this feature.

http://www.linuxuser.co.uk/features/run-linux-on-android-part-1

a common trick when generating random passwords is to Base64-encode random bytes

Originally shared by Sakari Maaranen

On UNIX and Linux systems, a common trick when generating random passwords is to Base64-encode random bytes; for example, this generates an 18 character long Base64-encoded password:

echo $(base64 /dev/random | head -c 18)

That’s fine, but the plus and slash (also underscore and hyphen) characters used in standard Base64-encoding schemes are laid out differently on the keyboard depending on country. This can cause trouble when trying to log on the machine, if the locale setting doesn’t match that of the actual keyboard used.

One way to solve this in environments where you need to deal with many locales, is to generate passwords using only those characters that are laid out the same regardless of locale.

Now try this:

echo $(cat /dev/random | tr -dc ‘!%,.0-9A-Xa-x’ | head -c 20)

Use one of the following strings between the single quotes on the above command line:

This generates a strong password that works the same with US, UK, German, and Scandinavian keyboard layouts:

!%,.0-9A-Xa-x (N=62)

If you don’t care about the German layout, you can use:

!%,.0-9A-Za-z (N=66)

If you want to support French as well, then you can only use:

0-9B-LN-PR-VXb-ln-pr-vx (N=50)

You can find the appropriate password length by replacing the desired bits of entropy for H and the above given value for N, typing the following in Google search:

H / (log(N) / log(2))

Always round the result up.

If you don’t know how many bits of randomness you need, just use H=96, but be warned: If you’re working on anything serious, you’d better educate yourself and make sure you know how many bits you want.

 

find, xargs

Originally shared by Xah Lee

: the most powerful shell command. Master it. find, xargs. Here’s some commen patterns:

#  show just files ending with .html

find . -name “*.html”

# larger than 9 Mega bytes

find . -size +900000c

# delete all files whose name ends with ~.

find . -name “*~” -exec rm {} \;

# delete all empty files

find . -type f -empty -exec rm {} \;

# delete empty dirs

find . -depth -empty -type d -exec rmdir {} \;

# file status changed in last 60 min

find . -cmin -60

# file content modified in last 60 min

find . -mmin -60

for more, using xargs examples, see

http://xahlee.info/linux/linux_shell_find_example.html