Wednesday, April 23, 2014

Debian Core - Tricks & Tips

If you don't have Debian Core installed, here is the tutorial.  These are some tips and tricks that I have found useful. Use ROOT for all of these.

Hide This Login Information
touch ~/.hushlogin


Install Archey And Have It Run After login
apt-get install lsb-release scrot python ca-certificates

wget http://github.com/downloads/djmelik/archey/archey-0.2.8.deb

dpkg -i archey-0.2.8.deb

nano ~/.bashrc

Add these lines to the bottom - host -i displays the connected IP address

clear
archey
hostname -i
echo

To add to other users besides Root - nano /home/YOURuserNAME/.bashrc

clear
archey
hostname -i
echo

Auto-Login / Disable Extra ttys
nano /etc/inittab

change tty1 to: 1:2345:respawn:/sbin/getty tty1 --autologin root
User name is at the end.
I didn't notice any speed improvements, but if you want to disable tty3-tty6, comment them out with a #
Do NOT comment out tty1 or tty2


Enable Tab Completion
This allows you to use TAB when typing to save time.

apt-get install bash-completion


Skip GRUB Boot Menu
nano /etc/default/grub

Change GRUB_TIMEOUT=5 to GRUB_TIMEOUT=0

update-grub

Random Mac On Boot




apt-get install macchanger
nano /etc/init.d/macchanger

Add these lines (Change/remove eth0 and wlan0 if needed - ifconfig to check)

ifconfig eth0 down
ifconfig wlan0 down

/usr/bin/macchanger -r eth0 >/dev/null 2>/dev/null &
/usr/bin/macchanger -r wlan0 >/dev/null 2>/dev/null &

ifconfig eth0 up
ifconfig wlan0 up

dhclient eth0 >/dev/null 2>/dev/null &
dhclient wlan0 >/dev/null 2>/dev/null &

chmod +x /etc/init.d/macchanger
update-rc.d macchanger defaults 10
To check the difference after a reboot - macchanger -s eth0


Disable SSH Service On Boot
update-rc.d ssh remove

To start the service when you want to (root needed) service ssh start
To check if ssh is running service ssh status

Sunday, April 20, 2014

Install Debian Core (No GUI) - Tutorial


How to install Debian Core (No GUI). Install size is around 433MB.

Video Tutorial Here

1. Download the Debian Net Install ISO from here. (From the official site)

2. Burn debian-*-netinst.iso to a disc. -- I use Free ISO Burner since it doesn't need to be installed. It can be downloaded Here Browse for the .iso and then click Burn on the bottom left. -- I suggest removing all storage devices before install to keep from formatting the wrong device.

3. Insert the cd and reboot the computer. Boot from the cd by changing the boot order.

Dell  -  F12
HP   -  F9
4. You can go with Install, but for this tutorial I will be using Graphical Install.
5. Select your language, location, and keyboard.
6. Give the install a hostname. Can be anything you want. This is the name your install will show up as on the network.
7. You can click Continue when asked for a Domain Name.
8. Enter a password you want to use for root privileges.
9. Enter your name, your user name, and then the password you want to use.
10. Select you time zone.
11. Select Guided - use entire disk (This will delete EVERYTHING on the device)
12. Select the device you want to install it on.
13. To make things easy, select All files in one partition.
14. Click on Finish partitioning and write changer to disk.
15. Click Yes to confirm the partitioning settings.
16. Select your country again. Next select the server you want to download from. Unless you are behind a HTTP proxy, leave the box blank and click Continue.
17. Select whether you want to send anonymous usage statistic data.
18. Uncheck Debian desktop environment and any other packages you don't want.
19. Select Yes to install the GRUB boot loader. Lastly remove the CD and then click Continue to finish the installation.

Congratulations! Debian Core is now installed and running!

Extras

* To hide this type in: touch ~/.hushlogin


* Run updates:

su
apt-get update && apt-get upgrade



* Skip GRUB boot menu

su
nano /etc/default/grub

Change line to say GRUB_TIMEOUT=0



Tuesday, April 1, 2014

Tint2 Dock

Simple Tint2 Dock Config

#Panel
panel_position = center right vertical
panel_size = 22% 46
panel_items = L

#Launchers
launcher_item_app = /usr/share/applications/terminator.desktop
launcher_item_app = /usr/share/applications/chromium.desktop
launcher_item_app = /usr/share/applications/geany.desktop
launcher_item_app = /usr/share/applications/Thunar.desktop

#Panel Autohide
autohide = 1
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
autohide_height = 0
strut_policy = minimum

Change the dock location - Change what is behind panel_position
Add icons - Add launcher_item_app = followed by the launcher location
If you don't want the dock to hide - Remove this and everything below it #Panel Autohide

If you want multiple Tint2s on startup
Edit the startup file with an editor, or open it though the terminal.
geany ~/.config/openbox/autostart
Add this under what's already there.
(sleep 1s && tint2 -c ~/tints/dock ) &
~/tints/dock is the location of the file.

Saturday, February 15, 2014

pwgen Script - Linux


A simple script I created that asks a character length and outputs random characters to use as a password. The script uses pwgen. (Password generator) This is useful if you're using Openbox and want pwgen on the right click menu, or have a hard time remembering the command. You will be asked how long long you want the password to be, then it will display a random output with special characters included.

Video tutorial/in action: Here

1. Open Terminal and enter:
sudo apt-get install pwgen
2. Followed by 
touch ~/script.sh && chmod +x ~/script.sh
3. Open the file manager. Right click on script.sh, go to Open with and select your editor.

4. Add this in, then save and close.
#clear   #Used if opened from the terminal
read -p "Character Length: " number
clear
echo
echo
pwgen -y -1 "$number"
echo
echo
5. The script can be opened in the terminal.
sh ~/script.sh

Using Openbox's menu to execute the script
1. In the terminal type:
obmenu
2. Enter a name for the label. (This is what shows up when you right click) I used pwgen.

3. Add this to Execute at the bottom
terminator --command="sh ~/script.sh; echo; ${SHELL:-bash}"
Replace ~/script.sh to the location and file name of your choice

4. Click Save at the top. Right click on the desktop, then select pwgen to launch the script.

Wednesday, February 12, 2014

Block local ip or a website - Linux Script

This is a simple script that uses the tcpkill to block internet access to a specific machine on a local network or a website from the entire network. When a website is blocked, you will still have access to it. If the target is blocked, they will still show an active connection in the tray.  -- Use with LAN connection works, WLAN doesn't work all of the time.

The tutorial at the bottom integrates the script into the right click menu of Openbox.

Video tutorial / in action: Here

1. In the terminal enter sudo apt-get -y install dsniff --no-install-recommends
2. Enter  nano ~/script.sh
3. Paste this in


LanInt="eth0"

function BlockConnection
{
if [ -n "$(pidof tcpkill)" ]; then killall tcpkill >/dev/null 2>/dev/null; fi  #Stop

#Option Menu
if [ -z "$(pidof tcpkill)" ]; then clear; echo; echo
echo "    Block Website/Webpage or IP Address"
echo
echo "    (1) IP   (2) Website   (3) Cancel"
echo
read -p "                 > " BlockCheck
if [[ "$BlockCheck" == "1" ]]; then clear; echo; echo; echo; read -p "       IP Address: " BlockSite     #IP
elif [[ "$BlockCheck" == "2" ]]; then clear; echo; echo; echo; read -p "       Website/Webpage: " BlockSite #Website/Webpage
elif [[ "$BlockCheck" == "3" ]]; then MainMenu
else BlockConnection; fi

#IP
if [[ "$BlockCheck" == "1" ]]; then clear; tcpkill -i $LanInt -9 host "$BlockSite"; fi

#WebSite/Webpage
if [[ "$BlockCheck" == "2" ]]; then 
if [[ "$BlockSite" == *"www."* ]]; then BlockSite="$BlockSite"; else BlockSite="www.$BlockSite"; fi #Add www.  (If needed)
clear; tcpkill -i $LanInt -9 host "$BlockSite"; fi
fi
 }

BlockConnection


4. Save the script
5. Lastly type sudo chmod +x script.sh


eth0 for wired connection or wlan0 for wireless
6. Open a terminal and enter:
sudo sh ~/script.sh

Using Openbox's menu to execute the script
1. In the terminal type in obmenu
2. Enter a name for the label. This is what show up when you right click. I used Bock Connection.
3. Add this to Execute at the bottom
 terminator --command="sudo sh ~/script.sh"
Replace ~/script.sh to the location and file name of your choice
4. Click Save at the top. Right click on the desktop, then select Block Connection to launch the script

Sunday, January 26, 2014

XBMC/Steam Seamless (Linux) - Tutorial

XBMC launches after the boot process finishes. When Steam is opened from XBMC, XBMC close and Steam starts in Big Picture Mode. When Steam is closed, XBMC re-opens. This setup is Solid State Drive ready. A SSD is not required, but preferred. This setup works with a wired Playstation 3 controller.

Link to forum of the XBMC add-on: Here
Ubuntu 12.04 download link: Here
Video tutorial: Here
In action: Here

1. Do a fresh install of Ubuntu 12.04. Do not encrypt the Home folder and keep everything in one partition.

2. Right click on the desktop, and select Change Desktop Background. Click the drop down arrow next to Wallpapers tab on the top right. Select Colors & Gradients. Click the first colored box on the right side (there should be three of them. Towards the middle there is another box to the left of a [+] icon, click the box and change the color to black.
3. Open a Terminal (Left click on the top left icon and search for Terminal, or CTRL + ALT + T), and enter wget www.dropbox.com/s/wn900v3upfpjr04/1.txt

4. Open the top left orange icon. There will be a file called 1.txt Double click that file. You can close out of the orange file manager. If you closed the Terminal, open another one. Copy and Paste these lines in one at a time (MAKE SURE IT'S IN ORDER WITH THIS GUIDE)

Tip: To clear the Terminal press CTRL + L

sudo apt-get remove mahjongg gnome-sudoku aisleriot gnome-font-viewer simple-scan shotwell firefox firefox-gnome-support firefox-locale-en transmission-common transmission-gtk remmina gwibber gwibber-service thunderbird thunderbird-locale-en empathy empathy-common libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-draw libreoffice-math libreoffice-writer libreoffice-calc brasero rhythmbox ubuntuone-client ubuntuone-installer usb-creator-common usb-creator-gtk update-manager update-manager-core update-notifier-common update-notifier net-tools onboard xdiagnose xterm gnome-nettool gnome-screenshot gnome-screensaver gnome-system-log gnome-online-accounts gnome-orca eog ibus system-config-printer-gnome totem evince im-switch compiz gnomine landscape-client-ui-install language-selector-gnome gnome-disk-utility gcalctool ubuntu-docs gnome-user-guide gnome-power-manager checkbox checkbox-qt vino deja-dup
sudo apt-get autoremove

sudo apt-get update && sudo apt-get upgrade

sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop


sudo apt-get install python-software-properties pkg-config software-properties-common cuttlefish gnome-
session-fallback util-linux udisks usbmount ntfs-3g

sudo add-apt-repository ppa:team-xbmc/ppa

sudo apt-get update

sudo apt-get install xbmc

sudo rm -fr /usr/share/example-content

rm -fr ~/examples.desktop ~/Public

wget raw.github.com/teeedubb/teeedubb-xbmc-repo/master/script.steam.launcher/script.steam.launcher-0.9.3.zip

sud
o gedit /etc/default/grub  – Change Time Out from 10 to 0

sudo gedit /etc/usbmount/usbmount.conf

Change this line:

FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus"

to this line

FILESYSTEMS="ntfs vfat ext2 ext3 ext4 hfsplus"

ntfs is added infront of vfat

sudo gedit /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

Paste this in the document, save it, then close it.

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

sudo gedit /etc/fstab – add noatime, to the front of      errors=remount Don’t forget the comma. There are no spaces between noatime,errors=remount

sudo gedit /etc/rc.local – add fstrim –v / above exit 0 (There is a space after the m)
gconftool-2 -s /apps/metacity/general/num_workspaces --type int 1

dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1

5. Click the foot icon to the right of your user name. Select Ubuntu (No Effects), type in your password, and then press enter to login.
6. Click Applications in the top left corner, then click Ubuntu Software Center. Search for Steam in top right corner. Click Steam and then More Info blow the icon. Click buy on the right side above the preview photo. Accept the terms, then sign in/signup to install it.

If an error pops up saying the Software Center has crashed, uncheck the top box, check the bottom box, and click Leave Closed.
7. Open Steam, so it can go through the update process. Login when it's finished.

8. Open XBMC, and install the add-on located in the Home folder. System > Add-ons > Install from zip file > Home Folder > script.steam.launcher.zip file at the bottom. Press ESC twice to go back to the main screen.

9. Navigate to Programs towards the left. Go to Steam, press the letter C on your keyboard, and select Add-on settings. Change to the Advanced tab at the top. Check Make steam-launch.sh executable on next run. Hit the letter C again, then add it to favorites. You can add Steam to the Main menu by going to Settings > Appearance > Settings > Add-on (Shortcuts) > Add-on 1. Check 13:36 in the video if you have problems finding where to go.

10. Navigate to Settings > Services > Remote Control > make sure both of these are unchecked.
11. Exit Steam. (Letter S on the keyboard will bring up the option)

12. Click on the gear in the top right corner and select System Settings... Select User Accounts, click on the padlock in the top right corner (Says Unlock next to it). Type in the password, then click the button next to Automatic Login. It should now say On. If it says Off, click it again
13. Click All Settings in the top left corner. In the top row, click on Brightness and Lock. Where it says Turn off screen when inactive for: 10 minutes, click the 10 minutes and change it to Never. Click the button below Lock. It should now say OFF. Uncheck Require my password when waking from suspend
14. Open Cuttlefish – Applications > Accessories >  Cuttlefish
            A. Click New
B. Name it XBMC/Steam
C. Turn off notification
D. Click Stimulus > Set Application Stops
E. Set Application to Steam
            F. Go to the Reaction tab
            G. Click plus sign at bottom left
            H. Choose Start Application > Choose XBMC
            I. Edit (On top bar, left side) > Preferences > Autostart
15. Turn the volume up all of the way.
16. Hold down the Alt key and right click on the bottom panel. Click Properties, and check the Auto Hide box.

17. Open Terminal and enter these four sets one at a time.

sudo apt-get remove software-center appmenu-gtk appmenu-gtk3 appmenu-qt unity-2d unity-lens* unity-services unity-common compiz-core compiz-gnome compiz-plugins-default compizconfig-backend-gconf update-manager update-manager-core update-notifier

sudo apt-get autoremove

sudo apt-get update && sudo apt-get upgrade


rm -fr ~/script.steam.launcher*.zip

18. Click the gear in the top right corner, then click Startup Applications… and uncheck these: (Some might not show up)

- AT SPI D-Bus Bus
- Disk Notifications
- Files
- GPG Password Agent
- Gwibber
- Mount Helper
- On Board
- Orca
- Personal File Sharing
- screensaver
- SSH Key Agent
- Ubuntu One
- Update Notifier
- Zeitgeist Datahub

19. Click Add on the right side. In the Name area enter XBMC, enter /usr/bin/xbmc, then click Add.

20. Hold down the Alt key and right click on the top. Click Properties, and check the Auto Hide box.

21. Restart


Working On
- Changing the boot logo/animation
- Hiding the curser
- When Steam restarts, XBMC opens.
- Using a wireless PS3/Xbox 360 controller
- Using a PS3 remote for XBMC