I got a little bored the other day and wanted to code something… anything. So I made this password generator script and before anyone decides to mention it, I DO know you can generate passwords using the bash shell via /dev/urandom. Anyways, here is a link to the python script.
Ubuntu and WUSB600N
Well, I am not a huge Ubuntu fan by any means but one of my friends uses it and needed to get his WUSB600N working so he could use his WiFi. So with a little research this is how I managed to get it fully functional with Linux drivers. First off, we will need to collect a bit of information about your dongle. Mainly, we just need the ID of it. So open your Terminal and type in: lsusb | grep Linksys Continue reading
Scripts
I was bored today so I have reorganized some of the scripts I wrote, and some I found, from script files in to my .bashrc file (some I left out because of size or complications). One of the scripts I wrote today is called logviewer. I wrote it mainly because I wanted some practice using getopts in Bash. Basically, it views logs in /var/log/ with less typing. To use it, at least on Arch, you will need to cd to /var/log/ and chmod the contents of the directory to 744 (sudo chmod 744 /var/log/*). If you don’t use sudo, then use su or temporarily log in as root. Here is the script: Continue reading
Change Directory script
Here is a bashrc function that I originally wrote as a script but was suggested as a function inside of the bashrc file. By placing the function inside the bashrc file, you do not have to source it.
up() {
local x=”
for i in $(seq $1)
do
x=”$x../”
done
cd $x
}
Now instead of typing cd ../../../ to navigate back up the filesystem tree or typing some long pathname, you can simply type ‘up 3′ instead of cd ../../../
Run X software remotely
I was recently scouring the web for a tutorial on how to run X programs through ssh on the remote computer. All I could find is how to run X programs on a remote computer and have it display on the local computer. This is NOT what I was wanting. For example, say my wife is on PC1 and I am on Laptop1. I use Laptop1 to ssh to PC1. From Laptop1, I wish to type xeyes and have xeyes display on PC1. From what I can see, this is not possible unless you use VNC which is something I didn’t want to do. So, of course, I solved this program by having a bash script run at start-up on PC1. Here is the script: Continue reading
Using CHMOD
I learned something new yesterday about chmodding and I wish to share this with you. It makes chmodding a hell of a lot easier. If you go in to a terminal and type ls -l it will show you a directory listing of your current working directory with the permissions of each file. Allow me to introduce you to the classes.
- User class: This set of permissions are define for the owner of the file.
- Group: For others who are in the same group as the owner of the file.
- Other: This is for everyone else. Continue reading
Sudoers: Reboot/Shutdown w/o PW
Depending on what system you are using, you sometimes will have to manually add the ability to use /usr/bin/reboot and /usr/bin/shutdown without entering a password. This is necessary if you want one-click reboot and shutdown. To do this, open up a terminal and type the following: Continue reading
Setting up your IPTABLES
If you are going to have your linux machine connected to the internet, then it would be a good idea to set-up your iptables. First off, make sure you have iptables installed. The proper command to install ‘iptables’ is: Continue reading
Adding aliases to your bashrc file
I would like to kick this off by informing any new Linux users that Aliases are, for all intesive purposes, a must-do for your system. Whether you want to or not, you will be using the command-line on a regular basis. Refusal to use the command-line will truly hinder your ability to control your system, therefore Continue reading
Script to make FILES in a directory accessable to ROOT only.
The following script was created to make a directories content available to ROOT only. I did this because sometimes I will log in to my computer to let people use the internet, use OpenOffice, whatever and I don’t want them to nose through my shit (i.e. Porn.. LOL). Anyways, that is MY use for this script. So, if you have a Scripts directory, create a new file and chmod it to 700 so you can execute it. Continue reading