July 22, 2012: Episode 7x20
PLAY:
Ogg 7x20 |
Speex 7x20
The two hour season finale. Klaatu crash lands on an ancient planet and must learn its terrible secret.
Nah, not really. It's just Klaatu reading listener
feedback, talking about find and xargs and other bash
tricks, YaST, the GPL. Unconfirmed rumours also tell of
a second, bonus coffee break!
Updated Shownotes
Jimzat asked for shownotes, and GNU World Order
delivars!
Find
The find command is like grep except it works on filenames instead of
file contents.
Find Examples:
-
You can search your home directory for a file that starts
with the string "foo" and ends with anything:
$ find ~ -iname foo*
~/foo.txt
/foobar.txt
/docs/foo2.txt
-
Or search your music folder for anything containing the
string "clay"
$ find ~/albums -iname *clay*
~/albums/clayHawkins_RoadSoulOne.ogg
~/albums/Clay_Hawkins_effortsInInvention
/albums/hawkins_Clay_-_static_-_FullAlbum.ogg
There are lots of other attributes of a file you can search
or use in your search, such as the case-sensitive -name, or creation time,
or the modification time, and much more.
-
The -exec flag is a powerful
switch that you can use to execute a command against the
result of your find command. In a
way, it's a quick-and-dirty for loop!
$ find /media/drive/ -name
DS_Store -exec rm -i {} \;
Notice that {} stands in
for "the result of find".
The -exec phrase must be closed
with \; or you'll get an error.
Xargs
Takes the results, or the standard
out, of one command and magically transforms it into the
standard in of another command.
Xargs Examples:
-
It's sometimes easier to understand xargs by not using it first.
$ echo "foo bar baz" >
fooBarEtc.txt
$ cat $(ls | grep -i foo)
foo bar baz
Let's try something similar but add xargs a little bit:
$ ls | grep -i foo | xargs
cat -
foo bar baz
-
Using xargs in a more useful
way, we could use it in combination with a bunch of
commands to create a command so powerful that most
people would be willing to pay $10 for it on some
shareware site.
For instance, let's say we have a website and we need to
go through all of its pages and change the word
"windows" to "linux"
We could open each .html file in a text editor and do a
find/replace, or if we were a little more skilled we
might run sed on each file, or
create a for loop that runs sed. But even better, we could do it
all with xargs.
$ grep -i windows -l
./*html | xargs sed -e 's_windows_linux_g'
- SHA256sums:
- ogg e50d8e21b8864aa194ea5d9408f5d51d52d3169c0b51ac20e9eb79678226ea2c
- spx 0185689d8bc98d8b65b34c15dd24e2706be988b5b183a4ad78ab32acbd005e84
- Important Links:
- CPAN - Comprehensive Perl Archive Network
- Sweet Maria's Coffee Roasting site
AcidRip
video-meta - a nice script to analyze video and audio files
July 8, 2012: Episode 7x19
PLAY:
Ogg 7x19 |
Speex 7x19
GNU Emacs has package management now. HOWTO be a good little Slacker.
- SHA256sums:
- ogg 138dbc9895628524a9bdb8812b8b4ca6f60adb3d250a29889832b6f36b6399cb
- spx d0f5bef37df854e06fd439daf7c97365674f8253e351aeeee847f691055f842a
- Important Links:
- GNU Emacs 24.1 wiith
package management
- Slackbook
June 10, 2012: Episode 7x17
PLAY:
Ogg 7x17 |
Speex 7x17
Klaatu talks about listener feedback, BSides Security
Conference and reverse engineering patches (not a HOWTO,
just that it exists), a failed QR Code experiment, the
qrencode application, explains (more or less) what the
heck a filesystem is, how users shop for new software,
upgrading to Fedora 17 via Anaconda, and more. Also, a
new Fat Chance Lester album is out, and all intro,
outro, and segue music on this episode was taken from
it. Check it out via the link below!
- MD5sums:
- ogg 1c678a0f0ef2d247d8309868f388ef45
- spx 840cc1a2908ffa4ea283023b5035c6ff
- Important Links:
- Southeast Linux Fest
- Ghost of a Chance - the new Fat Chance Lester album
discussed in this episode
May 27, 2012: Episode 7x16
PLAY:
Ogg 7x16 |
Speex 7x16
Klaatu muses over packaging, the UNIXness of packaging
systems, Gnome3's inclusion of Google as its default
(immutable?) search
engine on both desktop and browser (which Klaatu incorrectly refers to as "evolution" when he really meant "epiphany" "web") (thanks to Thrice in IRC for clarification), thelastknowngod's tip
about the free command, ClaudioM's
tip about arp, and more!
- MD5sums:
- ogg 9c1ae6995e725d95e42a69323d1c028f
- spx 051b629106545c6182a8df2e31b71b5c
- Important Links:
- linuxAteMyRam.com - a great
site thelastknowngod found
- Gnome Desktop
- the updated Slackermedia still exists
- sbo_tools by nihilismus,
discussed in this episode
- sbo-tools by vbatts, not
discussed in this episode but worth looking at
April 29, 2012: Episode 7x14
PLAY:
Ogg 7x14 |
Speex 7x14
Klaatu interviews ScottL, maintainer of the Ubuntu Studio project.
- MD5sums:
- ogg 8bd50107e4035b0cf3a9abe52255117e
- spx 6f2f80e830b5219fea599a44079e53a1
- Important Links:
- Ubuntu Studio
- another gnu+linux multimedia solution based on slackware
March 31, 2012: Episode 7x13
PLAY:
Ogg 7x13 |
Speex 7x13
Klaatu sets up a git server, reviews listener feedback, including the GNU World Manifesto by (whether he knows it or not) Kristian-from-London, and relates JessiJames's tip on how to set up and use encrypted thumbdrives seamlessly on Linux. No April Fools jokes in this one; didn't quite plan that far in advance :)
Updated Shownotes
Ken Fallon emailed and demanded shownotes, and when Ken
Fallon demands something, you don't ignore him. So:
Git Server
Setting up a git server is easy! Klaatu does this on a local
server; if you intend to do it on a world-facing server, you
should probably look into increased security. Either way, the
simplicity and ease is pretty much the same:
On the server:
First, configure your git environment:
$ git config --global user.name "Klaatu von Schlacker"
$ git config --global user.email
klaatu@haackerpubllcradlo.0rg
-
Then make a new directory where your files will be
stored. It's not a bad idea to append it with .git, just because everyone else
(gitorious, github, etc) seems to do it that way.
$ mkdir
gnuworldorder.git
-
Then cd into the new directory
and initialize it as a bare (yes, bare. empty. void.) git
directory.
$ cd !$
$ git --bare init
$ pwd
That's all you need to do. It's set up. You're done. No,
seriously, it is.
Of course you'll want to now use it. Here's how.
On the client:
-
First clone the empty repository.
$ git clone 192.168.168.192:/home/klaatu/gnuworldorder.git
Git will cheerfully warn you
that you've just cloned an empty repository. That's not a
problem.
-
Next, cd into your new
directory:
-
Now you can start putting files into it. You can cd or mv
stuff into it, or just create new files with GNU Emacs or whatever.
$ echo "Gort, Klaatu
barada nikto." > qotd.txt
-
Now you've got a new file. See its status with:
This will reveal that yes, the file qotd.txt exists, but that it is untracked, meaning that git is not
(yet) keeping track of the file or whether it has
changed or not. We should fix that.
-
To add the file into git
proper, use:
The command is obvious. We use a dot at the end to mean
"add everything in this current directory that has been
modified or has changed".
-
If you're sure you want this file added into git, then
you should commit it. If you suddenly have a change of
heart, you can use git reset...but let's assume you want to commit:
An editor will open, and you should type in some kind of
commit message that will be meaninful to yourself and
others. Save the file, quit.
-
Now you can push the change to your git server. Since
this is the first time you're ever pushing to this
heretofore empty repository, you must use:
Once your initial commit is made, you can just use:
-
Curious about the history of your commits? use git log
Git in action
OK, so let's say that you do something crazy like:
$ echo 1 > qotd.txt
$ cat qotd.txt
1
You've just erased your entire qotd.txt file! What do?
Well, git can help:
$ git checkout qotd.txt
$ cat qotd.txt
Gort, Klaatu barada nikto.
Saved by git!
Encrypted thumbdrives with luksFormat
Jessijames in IRC taught Klaatu this trick. If you are on
freenode.net and happen to see Jessijames wandering around, thank
him for the lesson!
-
First, plug in your thumbdrive and make darned sure you
know where it is:
$ su -c 'dmesg | tail'
[1689579.379113] sdc: sdc1
[1689579.381433] sd 27:0:0:0: [sdc] No Caching mode page
present
[1689579.381435] sd 27:0:0:0: [sdc] Assuming drive cache:
write through
In the case above, my thumbdrive is clearly attached to
sdc and has one partition (sdc1) on
it.
-
If your drive has no partition on it, or too many, or you
just feel you need to reset it, you can make a new partition
table with cfdisk or fdisk or whatever. Also, we'll become root
so we can manipulate devices and mount them and so on:
$ su
# parted /dev/sdc
(parted) mktable
New disk label type? msdos
(parted) quit
-
Now to set up an encrypted container in which we can house
our secret filesystem.
# cryptsetup luksFormat
/dev/sdc1
You'll be asked to confirm this action, and you'll be asked
to create a passphrase. You should do those things.
-
Next, it's time to mount the drive. Keep in mind it doesn't
actually contain a filesystem yet; but we need to decrypt and
mount the container so we can make a filesystem in it.
# cryptsetup luksOpen
/dev/sdc1 zippy
# mkfs.ext2
/dev/mapper/zippy
-
Now we've got an encrypted container with an ext2
filesystem inside of it, located as an LVM volume at
/dev/mapper/zippy
Big deal. Now we have to mount
the filesystem so we can read and write to and from it.
In order to find out where the filesystem exists, we list
the /dev/mapper:
# ls -lh
/dev/mapper
brw-rw---- sdc1 -> dm-0
Ergo, my drive's mountable filesystem has a link to some
place called /dev/dm-0 (the decrypted version of the filesystem)
-
Mount the decrypted filesystem as you would any regular
drive:
# mount /dev/dm-0
/mnt/zip
cd into /mnt/zip and
make a directory for your normal user, and start using it!
When finished, umount as usual.
-
For bonus points, the next time you go to use the
thumbdrive, try it in the GUI (a "GUI" is kind of
like the Linux shell, but with wobbly windows). At least on
KDE, the thumbdrive's encryption is recognized and I'm
prompted to enter the password, and then it mounts as normal
in Dolphin. It's truly magical.
The GNU World Order Manifesto
By Kristian
-
Almost all people have the capacity to understand basic
logic/reasoning and given how obvious it is that there is terrible
suffering in the world, there is a morale imperative to seek to
understand and mitigate problems. This is basically the hacker ethic.
-
A little bit of knowledge significantly lowers the barriers of entry
for many computer uses, especially small server/website, multimedia
production, and even word processing. The user only gains this
knowledge by using simple approaches (ie, I don't have a computer science
degree but...)
-
There is no level of automated protection that can mitigate every
human error. If you install binaries on your pc without being certain
of their provenance you can never claim to be secure. In a networked
world the problem increases exponentiality. (The T0nid0 plug defaults
to serve your personal data to the world over an unencrypted
connection using an unsupported ubuntu install that runs entirely as
root-given that T0nid0 would never state this in their marketing or
the user manual, I had to rely on my self taught gnu/linux knowdedge
to understand my t0nid0 plug and never switch it on again!)
-
Introduction of code for no purpose involves taking risks with no
possible benefit (Many websites need 2 mb of html on a static page, but
run 30mb of php with all kinds of plugins that the user doesn't
understand or need.)
-
It is inevitable that a computer user will need to intervene when
something doesn't work. The problem is that if the user knows nothing,
they end up going onto the Ubuntu forum and cutting and pasting sudo
rm -rf / into a terminal thinking that it will install mscorefonts.
That's it! Thanks for reading the shownotes.
- MD5sums:
- ogg 032281a617ca6cde528301e26896f2e4
- spx 8ccfa4878b09f1f3042501a91741030e
- Important Links:
- Join The Game by becoming a card carrying KDE party member!
- Bill von Hagen's Git article
- the Git Community Book
- Slackermedia