screen

linux, screen

I noticed that sometimes even if I would scp files from server to server, the connection would eventually timeout as soon as I logged out of the machine.

One solution is to use the excellent application ‘screen’. This allows you to multiplex more than one virtual console, keeping the terminal alive even if you are disconnected on your connection.

To create a screen, simply run:

screen -R "some_terminal_name"

When you want to return to the original window, you can hold CTRL+A+D. That takes you back to your original terminal. IF you want to return to the screen again, use the same command as mentioned above.

Fun with exim

exim, linux

exim is a mail transfer agent for Unix environments. exim follows the sendmail design model, and is highly configurable with many features.

Some of my favourite commands are:

exim -bp | exiqsumm
- Generates a summary about all of the messages currently in the queue, including total and time spent in the queue
exiwhat
- Shows what exim is currently doing
exim -Mrm <message-id>
- Remove a message from the queue
exiqgrep -z -i | xargs exim -Mrm
- Delete all frozen messages from the queue

CUPS / Samba / Wireless Printing randomly stops working on Ubuntu

CUPS, linux, samba

I’ve setup a CUPS (Common Unix Printing System) wireless printer sharing in our office, and occasionally the wireless printing randomly stops working. In addition, Samba also stops for file sharing. This kind of behaviour is normally coupled with the LAN/Wireless connection dropping, so you cannot even SSH into the machine itself.

There is no need to restart the computer, just restart the network-manager from the machine itself.

sudo service network-manager restart

Network Manager in Ubuntu stopped picking up a wired network device

linux

This morning I had an issue where the standard Networking Manager in Ubuntu 11.04 failed to pick up a wired internet connection.

ubuntu 11.10 wired network device not managed

I’d been playing around with the interfaces file in /etc/network/interfaces, changing the settings for the ethernet and the wireless networks; but unfortunately neither helped.

After some Googling I found out that there is also another configuration file for the Network Manager in Ubuntu that needs some changing. That is fixed like this:


sudo vim /etc/NetworkManager/NetworkManager.conf

Changing from managed=false to managed=true and then restarting the network manager service worked a treat and now the Ethernet is now properly connected

Finish up with a restart of the network manager and then you’re good.


sudo service network-manager restart

Setting up a Samba fileshare on the command line on Linux

linux, samba

Setting up a Samba fileshare on Linux (I prefer Ubuntu for myself) from the command line is simple enough and very easy to configure.

Create the folder, chmod the folder to full read and write settings and set the folder ownership to “nobody”. This should be OK as hopefully you’ll only have access to the shared folder on your local network.

Meanwhile, one line on the CLI will enable the file sharing settings:

net usershare add shared /home/yourhostname/somefolder/shared "yourhostname shared" everyone:F guest_ok=y

That should be it. You can then access the folder with no passwords and from any machine on the local network.

Confirm your settings are OK when running this command below:

root@yourhostname/home/somefolder/Desktop# net usershare info --long
[shared]
path=/home/yourhostname/Desktop/shared
comment=yourhostname shared
usershare_acl=Everyone:F,
guest_ok=y