The following will recursively move items from archive_folder into the archive_file.zip
zip -m -r archive_file.zip ./archive_folder
Install/uninstall .deb files
These files are Debian packages. The package files associated with Ubuntu have the .deb suffix because of Ubuntu's close relations with the Debian GNU/Linux distribution. You will need administrative privileges to install a .deb file (see the section called "Root And Sudo").
To install a .deb file, simply double click on it, and then select Install Package
Alternatively, you can also install a .deb file by opening a terminal and typing:
sudo dpkg -i package_file.deb
To uninstall a .deb file, deselect it in your package manager, or type:
sudo dpkg -r package_name
To list you packages or to look for a specific one
sudo dpkg -l | grep -i packagename
Background Image Disappears in Ubuntu
Synopsis: gnome settings were corrupted
Fix with the following:
- rm -R .gconf/desktop/gnome/background
- Logout / Login
There was really only one file that was deleted from the fix:
.gconf/desktop/gnome/background/%gconf.xml
Details from original post:
When the picture_opacity value from the gnome background image is set to 200 the background image disappears and never comes back until the config files are removed.
Steps:
causes the problem: gconftool-2 -t str --set /desktop/gnome/background/picture_opacity "200"
solved the problem: rm -R .gconf/desktop/gnome/background (and restart gnome)
How to Install JDK 1.6 in Ubuntu, also how to run a bin file
Try this first just to get the jdk installed through apt-get
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-plugin
In order to change which JRE Ubuntu uses, run the following command from the terminal. I found this in the general Ubuntu help under programming.
sudo update-alternatives --config java
The Long Way, Good Learning Excersize
- Download bin file to a temp folder on your Desktop
- sudo su
- chmod a+x filename.bin
- ./filename.bin
- You can then cleanup the temp folder
As you will see, it's a little long process, but thanks to my curiosity I noticed that Ubuntu has a package ready to install using your package manager.
The java command to install it:
$sudo apt-get install sun-java6-jdk
The good thing is that Ubuntu has packages for things like flash and other softwares that are not easy to install on other distributions.
For some who want to try the long way here it is:
1. Download the Java JDK 1.6 from Sun's site. http://java.sun.com/javase/downloads/index.jsp
2. Select the Java SE Development Kit (JDK)
3. This leads to a page allowing us to select the Operating System, usually I just choose Linux :).
4. Then we came to a page which shows the available packages. I click on jdk-6u13-linux-i586.bin because this version is a package resembling to a tar.gz
5. Once the newly downloaded file is here, we need to extract it to a folder named jdk1.6.0_13 (for example).
6. It's better then to move Jdk1.6.0_13 folder to /usr/local which is the standard folder for programs or GUI console. if you have problems copying the JDK, you can call with the command nautilus
$sudo nautilus
This way you can access the folder /usr/local.
7. We will proceed to add the JAVA_HOME variable to the system. To do this, open bash.bashrc file with the following command:
$sudo vi /etc/bash.bashrc
At the end of the file put the following instructions.
export JAVA_HOME=/usr/local/jdk1.6.0_13
export PATH=$JAVA_HOME/bin:$PATH
This makes sure that the JAVA_HOME variable is always available in the system.
8. Open a new console and run the command:
$java -version
To which we assume the following result:
java version "1.6.0_13"
Java (TM) SE Runtime Environment (build 1.6.0_13-b04)
Java HotSpot (TM) Server VM (build 11.2-b01, mixed mode)
If it does not work: (good time to dig into Linux privileges). Here is the script you may need to use.
sudo chmod 777 /usr/local/jdk1.6.0_13
sudo chmod -R 666 /usr/local/jdk1.6.0_13
sudo chmod 777 /usr/local/jdk1.6.0_13/bin
sudo chmod 777 /usr/local/jdk1.6.0_13/db
sudo chmod 777 /usr/local/jdk1.6.0_13/demo
sudo chmod 777 /usr/local/jdk1.6.0_13/include
sudo chmod 777 /usr/local/jdk1.6.0_13/jre
sudo chmod 777 /usr/local/jdk1.6.0_13/lib
sudo chmod 777 /usr/local/jdk1.6.0_13/man
sudo chmod 777 /usr/local/jdk1.6.0_13/sample
sudo chmod 777 /usr/local/jdk1.6.0_13/bin/*
1990 Census Bureau Name Data
Notification messages with bash
sudo apt-get install libnotify-bin
notify-send 'title' 'body message'
notify-send --help
Beep command from bash script
You can use a beep command in your scripts, install and it plays from the computer's speaker.
sudo apt-get install beep
Logout user after 10 minutes
#!/usr/bin/bash
###
### Use this script to limit account usage
###
notify-send 'Session Timeout' 'Starting timer 15 minutes...' -u critical -t 10000 -i dialog-info
sleep 15m
playsound /home/mruckman/Scripts/ding.wav
notify-send 'Session Timeout' 'One minute before automatic log out. Save your work.' -u critical -t 60000 -i messagebox_critical
sleep 1m
### FORCE LOGOFF
gnome-session-save --force-logout --silent
### LOCK SCREEN, DOES NOT WORK IN ALL CASES
### gnome-screensaver-command --lock
Linux find command for a list of files or folders
Goal: Generate a simple text file with a list of files in it
find "/path/to/search" -type f | sort > list.txt
The -type f only returns files.
find /home/mruckman -maxdepth 1 -type d
The -type d only returns directories
mComix or feh Manga Command Line Viewer
Comix is a manga type viewer that works a bit like irfanview. Originally, I started using feh, which works from the command line but Comix seemed to meet my needs.
For Ubuntu 20.04 - MComix is a clone of Comix
Ubuntu has a command line image viewer called feh. Use apt-get to install it.
It has some basic commands, use the arrow keys to cycle through pictures, the v key to toggle to full screen.
[Shift]+[<] or [>] to rotate a picture
[Esc] or [Q] to quite
