Monthly Archives: June 2011

0

Getting a history of Package installs in Ubuntu or Debian

by

The original article appears here


zcat -f /var/log/dpkg.log* | grep " install " | sort

You could easily add a grep onto the end instead of the sort, to find a particular package. So something like


zcat -f /var/log/dpkg.log* | grep " install " | grep -i 'thunderbird'

2011-03-10 18:57:20 install thunderbird 3.1.8+build3+nobinonly-0ubuntu0.10.10.1
2011-03-10 19:02:36 install thunderbird 3.1.8+build3+nobinonly-0ubuntu0.10.10.1
2011-03-10 22:44:32 install thunderbird 3.1.8+build3+nobinonly-0ubuntu0.10.10.1
2011-02-10 00:51:40 install thunderbird-locale-en-gb 1:3.1.2ubuntu1
2011-02-10 00:51:43 install thunderbird-locale-en-us 1:3.1.2ubuntu1
2010-10-10 08:43:57 install thunderbird 3.1.4+build2+nobinonly-0ubuntu3

Wayno

1

Getting a Logitech USB headset to work with Skype and Debian on an Acer Netbook

by

Oh man. Some of the crazy solutions I found on the web. Fudgeting with .asoundrc files. Arghh.

Very simple fix! Get the latest Debian Skype version.

Plug in your Logitech USB Headset.

RIGHT Click on the Skype icon in the TASKBAR (not the desktop icon) – the one with a green check.

Skype Green Icon in the Notification Area

and highlight options. LEFT click on that, and find Sound Devices and “make it so:”

Skype Select Logitech USB Headset

Tada! Easy fix, after 2 days of schlepping!

Wayno

0

Creating a usb flash drive for a Debian install using Linux

by

Okay –

So I downloaded the debian iso, and burned it to CD. It was then that I discovered that my USB DVD writer, is now dearly departed. (In other words, it doe NOT work. As in: “It’s dead, Jim!”)

Soooo. What do I do…..Well I have a usb flash drive, but how do I get the iso image over to the flash drive?

AHA! dd to the rescue!

My usb flash drive is: /dev/sdd


sudo dd if=debian-6.0.0-i386-CD-1.iso of=/dev/sdd

Now sync the output.

sync

sync flushes any buffers in memory to the appropriate device.

about 20 minutes later, I was able to boot off the usb install image, and install debian.

Honestly, I did not know if this would work, but I didn’t know if it would NOT work! It does!

Thank you #debian guy for pointing out that it’s DEVICE not partition in dd. (don’t use it that often!)

Wayno

1

Monitoring CPU and Motherboard Temperatures in Linux

by

And so I asked Loni:

is there a way to look at motherboard/cpu temps via an ssh connection?

She said sure!


sudo apt-get install lm-sensors
sudo sensors-detect
sensors

Restart kmod:


sudo /etc/init.d/kmod start

And you will get output that looks something like:

it really was that easy –

Adapter: SMBus I801 adapter at 3000
in0: +1.26 V (min = +0.00 V, max = +3.32 V)
Vcore: +1.14 V (min = +0.00 V, max = +2.99 V)
+3.3V: +3.33 V (min = +0.00 V, max = +4.38 V)
+5V: +5.10 V (min = +0.00 V, max = +6.64 V)
+12V: +12.06 V (min = +0.00 V, max = +15.94 V)
fan1: 2132 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 657 RPM (min = 0 RPM)
temp1: +60.0°C (low = -127.0°C, high = +127.0°C)
M/B Temp: +41.0°C (low = -127.0°C, high = +127.0°C)
temp3: +48.0°C (low = -127.0°C, high = +127.0°C)
cpu0_vid: +0.000 V

Joe

for me I got:

sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +50.0°C (crit = +75.0°C)

k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: +75.0°C
Core0 Temp: +72.0°C
Core1 Temp: +74.0°C
Core1 Temp: +73.0°C

(Yes I do have a dual core 64 bit AMD System)

Ahh as always. YMMV (your mileage may vary) applies!

Thanks Loni and Joe

Yup supposed to be 110F/43C here later this week!

Wayno

5

100th Post — A special thanks

by

When i started this site over 3 years ago, I felt a little bit like Forrest Gump: Linux is like a box of chocolates. You never know what you’re going to get!

Little did I know when I started down this journey over 6 years ago, this is where I’d be.

I didn’t get here alone.

I need to thank several people.

First is Joe S. who patiently mentored and continues to mentor. He has entertained dozens of crazy things I have done. What I discovered is: there is more then one right solution in Linux.

Second is Loni. She always makes me do my homework first, but when I get stuck, is there to steer me in the right direction. She also is responsible for naming the site, pkill-9.

These two continue to serve as guides along this trek.

I also need to mention Brian L. (WB6RQN) whom I met at SDSU nearly 40 years ago. Unlike Al Gore, Brian really did help shape and guide the Internet into what it is today. Thank you for answering a lot of technical questions, and also helping me upgrade my amateur radio ticket.

Matt, who patiently tested a lot things for me, and help answer security questions. Matt is my oldest net friend.

Jeremy. Who hosts Pkill-9. We have taught each other many things over the course of the last few years.

Darren K, from Hak5 who inspires and encourages me.

Will. For the cheesy goodness you bring into my life, and for your friendship.

My parents. Who in their 80’s let me switch them from Windows to Linux. Proving that you’re never to old to learn something new.

José, Jason, Colin, and countless others I have helped down their own path.

To my best friend Brad B. While Linux is over his head, I wouldn’t be here without his support.

And finally the Kittiehs:

Abby and Hetty

This site is my way of returning to each of you, a hearty thanks and a legacy.

and so it goes….

Wayno
KA5FVE

0

Building your own ftp server in Linux using vsftpd

by

I am asked frequently: How can I make my own ftp server?

FTP — or file transfer protocol, was one of the original protocols used in the development of the Internet. It allows us to transfer files between a server machine (host) and a client. With the advent of peer-to-peer Bit Torrent it might seem that ftp has fallen by the wayside. Bit torrent is great, if you have a lot of the same information to share. Movies or music. But if you have only a few files to share amongst a small group of people, ftp is the way to go.

It’s not hard to implement, but there are a couple of tricks. This post will seem quite lengthy, because there’s a lot of concepts that we need to bring into focus. Security of course.

Here’s the setup. I want to use an account on my computer, that is just for sharing files with other people. Rather then have an account that only one local user can see, I need to have it visible to all local users, and to the ftp server.

So I stuck everything I wanted to share in /home/misc/example.

As always anything and including the octothorpe (#) is a comment, and need NOT be coded!

1. The first thing we will want to do is, get the software!


sudo apt-get install vsftpd # install the very secure ftp daemon

2. Let’s backup /etc/vsftpd.conf before we begin.


cd /etc # got to the /etc directory
sudo cp vsftpd.conf vsftpd.conf.bkp # make a backup copy

Here are snippets from /etc/vsftpd.conf. Use your favourite editor to change /etc/vsftpd.conf


# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
anonymous_enable=NO
#
chroot_local_user=NO
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
chroot_list_enable=YES
#
# (default follows)
#
chroot_list_file=/etc/vsftpd.chroot_list

3. Now we edit /etc/vsftpd.chroot_list and add the userid to be jailed:
(mrtestftp is the user I am using. Change it to whatever you decide.


mrtestftp

4. We’re done changing, so restart the vsftpd daemon to re-read all the changes.


sudo service vsftpd restart

if this is the first time running this, you may need start instead of restart.

5. Let’s make sure everything worked. Take a look at the system log file with:


dmseg

and let’s look at the vsftp log:


sudo tail -25 /var/log/vsftpd.log | more

you may have never seen the tail command. This says look at the last n lines (25) and pipe the output (take the output of one programme, and make it the input to the next programme) to more. More allows us to see a screenful of data at a time. To advance to the next page, simple hit the space bar.

6. And now, the tricky part. We have to change the home directory of our user (mrtestftp) from /home/mrtestftp to /home/misc/example.
System/Administration/Users and Groups

So let’s select our user:Before image

And this is the information we are going to change:

information to change

And we will get this warning:
warning after change

6. Ensure that your user, in my case mrtestftp, is part of the group users, in /etc/group


cd /etc # go to the etc directory
sudo cp group group.bkp # make a backup copy
grep users group # check to see what users are in the group users

You should get back a line that looks like:

users:x:100:user1,user2,mrtestftp

if the userid you want to use is there, great. Next step. If NOT, then edit the file /etc/group using your favourite editor, and add them.

NOTE: ANYTIME /etc/group CHANGES ARE MADE, YOU WILL NEED TO LOGOFF/LOGIN FOR THE CHANGES TO TAKE PLACE.

7. Fire up nautilus so we can make a change to the directory:


gksudo nautilus

BE CAREFUL HERE. We are going to change the group from mrtestftp to users. This way any local user can access these files.

change the group name to users

Alternately, you can use chgrp as well.

8. And finally, we need to change the permissions on the directory and files, so that everyone can access them:


cd /home/misc/example # navigate to the directory
sudo chmod -R g=rx example # allow the group to read and execute

or for us old guys:


sudo chmod -R 755 example # change the permissions so that the group can access

9. Testing —

:~$ ncftp -u mrtestftp wayno.abc.com
NcFTP 3.2.4 (Apr 07, 2010) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to 72.202.67.25...
"Welcome to Wayno's FTP service. "
Logging in...
Password requested by 72.202.67.25 for user "mrtestftp".

Please specify the password.

Password: ******

Login successful.
Logged in to wayno.abc.com.
ncftp /home/mrtestftp > dir
-rw-r--r-- 1 mrtestftp mrtestftp 56580 2008-11-30 00:11 abby_n_hetty.jpg
ncftp /home/mrtestftp >

10. Browser login:Logging into ftp, from a browser.

Thanks Joe.