ButteWifi

Here is a quick command to disable your monitor in Linux.
xset dpms force off
You can bind this to a keyboard shortcut or throw it in a script to quickly send your monitors to power-save mode without waiting a timeout period.

Read more...

§61 · October 20, 2009 · Uncategorized · 4 comments · Tags: , , ,


Here are some scripts that I wrote to mount and search bulk windows machines.
mountmachines.sh
#!/bin/bash
cd /searchmachines
echo “Username please”
read username
echo “Password please”
read -s password
for machine in `cat machinelist.txt`
do
mkdir remote$machine
echo “Attempting to mount $machine…”
mount.cifs //$machine/c$ ./remote$machine -o username=$username,password=$password
done
exit
This next script searches the machines for NTUSER.DAT files to find users that were logged in during a specific time frame.
search.sh
#!/bin/bash
cd [...]

Read more...

§46 · August 5, 2009 · Uncategorized · 1 comment · Tags: , , , ,


Normally my Internet connection is pretty good; but, once every couple of months, the provider changes something and my current IP address no longer works. The lease doesn’t actually expire, which is set to last 48 hours. So, I lose internet connectivity until a new renewal. It’s easy to do this by hand, but that [...]

Read more...

§42 · August 2, 2009 · Uncategorized · 2 comments · Tags: , , , , , ,


Here is a much easier command to get your key added to an authorized keys file on a remote server.
~$ ssh-copy-id username@remotehost.local

Read more...

§40 · August 1, 2009 · Uncategorized · 2 comments · Tags: , , , , , , , ,


Sometimes when a Linux system is unresponsive it seems like your only option is to hold down the power button.
Follow these key combos for a less risky reboot.
Hold Down Alt + SysRq and press R (raw keyboard mode) S (syncs disks) E (terminates all processes) I (kills the stragglers) U (read-only remount file-systems) B (reboots)
Give [...]

Read more...

§36 · July 19, 2009 · Uncategorized · (No comments) · Tags: , ,


So now you have key-based authentication setup for remote administration of your servers and you really want to crank up the laziness factor.
Remembering a password sucks, especially if you’ve eliminated them for logons. Now you only need it for sudo commands, right? NOT AFTER THIS DANDY!!
Every time you need to run something that requires root [...]

Read more...

§34 · July 14, 2009 · Uncategorized · 3 comments · Tags: , , , , , ,


Hello,
Windows = Still Exists
Administration from Windows of Linux = Putty
Key-based authentication from Putty = Puttygen
Launch the key generator included with Putty called PuTTYgen.
Click Generate. Move the mouse around for some good ol random numbers.
Stick a passphrase on it if you’re feeling insecure about yourself.
Save the public key somewhere and save the private key somewhere too. [...]

Read more...

§30 · July 13, 2009 · Uncategorized · (No comments) · Tags: , , , , ,


This little program allows you to mount a folder on a remote system to a local folder using ssh.
Install sshfs.
$ sudo apt-get install sshfs
Use the following command to mount a folder.
$ sshfs user@remotehostname:/path/to/remote/folder  /path/to/local/folder
You don’t even have to be root to mount.
You can speed the process up with key-based access.
See here. http://blog.buttewifi.com/?p=15

Read more...

§26 · July 12, 2009 · Uncategorized · (No comments) · Tags: , , , ,


The power button is pretty boring just turning the computer off.
Time to make it special for those headless Linux machines that play music but don’t have a keyboard.
Make sure ACPI is installed.
~$ sudo apt-get install acpi
Backup the old script.
~$ sudo cp /etc/acpi/powerbtn.sh  /etc/acpi/powerbtn.sh.bak
Clear all of that nonsense out of the old script and start with [...]

Read more...

§21 · July 9, 2009 · Uncategorized · (No comments) · Tags: , , ,


Here is a game that is worth your time. You even get to code it yourself.
Lolz. Needs a bash interpreter.
~$ nano guessinggame.sh
Paste this in there.
#!/bin/bash
echo “Please pick an integer between 1 and 10.”
read guess
number=0
while [ "$number" -le 1 ]
do
number=$RANDOM
let “number %= 11 ”
done
if [ $guess -eq $number ]
then
echo “You win!”
else
echo “You suck. The number was [...]

Read more...

§19 · July 8, 2009 · Uncategorized · (No comments) · Tags: , , , , , , , ,