Linux Blog

NetworkManager ‘device not managed’ Fix

Filed under: General Linux — TheLinuxBlog.com at 10:43 pm on Sunday, April 8, 2012

Recently I ran into an issue where a new installation of Debian didn’t have NetworkManager set up correctly. Everytime I tried to use NetworkManager it had an issue with the devices not being managed. Luckily there was a man page for networkmanager.conf and its a quick fix.

All you have to do is

sudo vi /etc/NetworkManager/NetworkManager.conf

and change:

[ifupdown]
managed=false
 
# to
[ifupdown]
managed=true
 
# Then
sudo service network-manager restart

And it’s fixed. Your wireless and ethernet connections will then be managed by NetworkManager. If you don’t want network manager to manage anymore you can just stop the service, or disable it at boot time by removing it from your /etc/rc[x].d/ directory where [x] corresponds to your runlevel. Enjoy!

Spring Cleaning

Filed under: General Linux,Shell Script Sundays — TheLinuxBlog.com at 6:30 am on Sunday, April 1, 2012

It’s that time of year, tree’s, plants and animals doing there thing. The time of the year where other wildlife and beings start cleaning up since the weather is nice. I guess it’s time for a post on some spring cleaning for the Linux folk

We will start off with a classic, sure to give you a clean start:
rm -rf .
Best done from root, just remember to press CTRL+c and/or reboot as quickly as possible when you realize what you have done.

On a serious note, I had a bunch of annoying hidden files in backup directories I wanted to get rid of. This did the trick.

find . -iname ".*"
find . -iname ".*" | wc -l
find . -iname ".*" | while read i ; do echo rm "$i" >> possibly_remove; done;

The above is conservative. ‘chmod 755 possibly_remove’, verify there are no files in there you actually want, you are in the correct directory then ‘./possibly_remove’ and you’re golden. Mmm. Spring freshness.

Since I like to live on the wild side, I run it without creating a file of files to delete that can be executed like this:

find . -iname ".*" | while read i ; do rm "$i"; done;

This will also work to cleanup nasty files that may have been accumulating a while that may be have left behind. It can be used to find and delete all Thumbs.db files by doing this:

find . -iname "thumbs.db" | while read i ; do rm "$i"; done;

The above is pretty careless, in most cases it probably wouldn’t hurt.

That is all the spring cleaning I have done, except for some random fsck’ing’ that was long overdue.