Environment related:
environment:$ printenvprint all environment variables
$ printenv SHELLwhat shell you are using
- 'set' sets environment variables and few other things.
- 'env' prints environment variables or runs processes in modified environments.
- Unlike 'set', 'env' only allows to set variables for the child process it starts - they do no stay in the current shell's environment.
$ env TERM=xterm mcbashrc:run the command 'mc' with TERM set to 'xterm' but the value of $TERM in the current shell will not be affected
$ set TERM=xtermwill change the value of $TERM in the current shell
- .bashrc gets executed on non-login shells (like after logging in, then opening a console)
- .bash_profile (or .bash_login) gets executed on login shells (when logging in, with username/password)
- /etc/bash.bashrc gets executed for all users
export PATH=$PATH:~user/software/binto the end of .bashrc
$ source ~/.bashrcshell function example, add the foll. into a shell file, which can then be invoked with the function nameto reload bashrc
function gitsync() { git add --all git commit -m "update" git push origin }
$ gitsync
Users and groups:
$ less /etc/grouplists all groups in the system
$ less /etc/passwdshows all the users in the system
$ groupadd groupNameadd a new group
$ useradd -G groupName userNameadd new user to existing group
$ passwd userNameset passwd for user
$ usermod -a -G groupName userNameadd existing user to existing group
$ id userNameshow id and groups for user
Packages:
$ alien file.rpmconvert rpm to deb
$ alien --scripts file.rpmconver rpm to deb, including scripts
$ dpkg -i file.debinstall deb file
Java install:
I had openJDK installed by default.$ java -version java version "1.7.0_09" OpenJDK Runtime Environment (IcedTea7 2.3.4) (7u9-2.3.4-0ubuntu1.12.10.1) OpenJDK Server VM (build 23.2-b09, mixed mode)Wanted to use the SunJDK, from Oracle now. So downloaded the tar.gz for Java SE Development Kit 7u13 for Linux x86 http://download.oracle.com/otn-pub/java/jdk/7u13-b20/jdk-7u13-linux-i586.tar.gz. Extracted that to jdk1.7.0_13.
$ sudo mv jdk1.7.0_13/ /usr/lib/jvm/jdk1.7.0 $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1 $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1 $ sudo update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 auto mode 1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 manual mode 2 /usr/lib/jvm/jdk1.7.0/bin/java 1 manual mode Press enter to keep the current choice[*], or type selection number: 2 update-alternatives: using /usr/lib/jvm/jdk1.7.0/bin/java to provide /usr/bin/java (java) in manual modeNow check the java version
$ java -version java version "1.7.0_13" Java(TM) SE Runtime Environment (build 1.7.0_13-b20) Java HotSpot(TM) Server VM (build 23.7-b01, mixed mode)
Displays related:
General
$ lspci | grep -i vgaSeiki SE39UY04 monitor / GeForce GTX 650 video cardshould show video card info
Got useful info from this post.
With this combination, Was only going upto 1440x900 by default. Needed to get the driver to acknowledge that this is a 4K monitor and should be able to run at 3840x2160.
Installed the nvidia driver, version 331.38. Then was able to fire up the nvidia x server settings utility. If not available, should be able to install and start up using
$ sudo apt-get intall nvidia-settings $ gksudo nvidia-settings
Then, created /usr/share/X11/xorg.conf.d/10-monitor.conf, with the following content:
Section "Monitor" Identifier "Monitor0" Modeline "3840x2160" 165.00 3840 3888 3920 4000 2160 2163 2168 2222 +hsync +vsync EndSection Section "Screen" Identifier "Screen0" Device "HDMI-0" Option "ModeValidation" "AllowNon60hzmodesDFPModes, NoEDIDDFPMaxSizeCheck, NoVertRefreshCheck, NoHorizSyncCheck, NoDFPNativeResolutionCheck, NoMaxSizeCheck, NoMaxPClkCheck, AllowNonEdidModes, NoEdidMaxPClkCheck" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Depth 24 Modes "3840x2160" "1920x1080" EndSubSection EndSectionOn reboot, Linux (Mint 17 XFCE, actually) then picked up and started running at 3840x2160. Note that this is still 30Hz, and not 60Hz, that might just be a limitation of the firmware on the monitor?
Databases related:
Install sql developerDownloaded Linux RPM sqldeveloper-4.0.2.15.21-1.noarch.rpm from http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
$ sudo alien --scripts sqldeveloper-4.0.2.15.21-1.noarch.rpmrpm to deb
$ sudo dpkg --install sqldeveloper_4.0.2.15.21-2_all.debinstall deb
$ cd /opt/sqldeveloper/to installed here
$ ./sqldeveloper.shto run
It needed a newer version of the jdk, so pointed it by setting
SetJavaHome /opt/jdk1.7.0_55
in ~/.sqldeveloper/4.0.0/product.conf
VirtualBox related:
To install a vm from an install ISO image- create a new virtual machine.
- Storage -> IDE Controller -> Live CD/DVD -> Choose a virtual optical disk file -> (browse to the iso)
- start the vm, and perform the install.
- shut down, remove the virtual optical disk.
- to be able to see the new vm from the host and other machines on the network, select "Bridged Adapter" as a network adapter. This should set up the vm to request and get an IP for the local network.
$ sudo apt-get update $ sudo apt-get upgradeUse existing vmdk
Copy over the .vmdk file and the .vbox files. Start virtualbox using the .vbox file. run virtualBox from the command line
$ VBoxManage list vms "Oracle 11gR2" {dbe091d1-2d58-432f-b23a-c4f9a6c47cb5} $ VBoxManage list runningvms $ VBoxManage startvm "Oracle 11gR2" $ VBoxManage showinfo "Oracle 11gR2"
XFCE tricks and settings
$ amixer set Master 5%-command line volume control decrease
$ amixer set Master 5%+command line volume control increase
$ xfce4-session-settingsfire up session settings applet
Alt F8start window resize (otherwise target only 1px wide in some themes)
Remote Access
RDPOn the server:
$ sudo apt-get install xrdp $ sudo service xrdp startOn the client:
$ sudo apt-get install rdesktop $ rdesktop ip.of.server.running.xrdpusing module sesman-Xvnc seems to work ok
Wordpress on LAMP server:
See here for a nice walkthrough.
installed ubuntu 14.04 server 32bit on a VirtualBox
chose LAMP server, and openSSH in software options
to test LAMP install:
http://10.216.30.62after the LAMP server install, set the required write permissions to the /var/www directory.should show contents of /var/www/html/index.html
$ sudo usermod -a -G www-datato test php, create /var/www/html/t1.phpAdd your user to the www-data group
$ sudo chgrp -R www-data /var/wwwadd the /var/www folder to the www-data group
$ sudo chmod -R g+w /var/wwwgive write permissions to the www-data group
<?php phpinfo(); ?> http://10.216.30.61/t1.phpto configure a database for WordPress to use:should show php config info
mysql -u root -pto install wordpress(enter passwd used during lamp install of mysql)
CREATE DATABASE wordpress; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';create user 'wordpress' with passwd 'wordpress' for database 'wordpress'
exit
$ sudo apt-get intall subversion $ cd /var/www/html $ svn co http://core.svn.wordpress.org/tags/3.9/ blog http://10.216.30.62/blogtest the download, and walk through config screen to create config file, click "install"
http://10.216.30.62/blog/wp-login.phpadmin login page
Linux Mint (Ubuntu) install related:
to change the lock screen wallpaper that is shipped with Linux Mint replace:
/usr/share/backgrounds/linuxmint/default_background.jpg
to install vpn client:
Open Connect client
$ sudo apt-get install openconnect $ sudo apt-get install network-manager-openconnectCisco VPN client
$ sudo apt-get install vpnc $ sudo apt-get install network-manager-vpnc $ sudo apt-get install network-manager-vpnc-gnome(the network-manager integration makes the vpn clients show up as connection options in the networkManager tray applet)
to add another drive:
$ sudo lshw -class disk(got info on the disks, to make sure not messing up the primary already installed disk)
ran gparted to delete partitions and format the new disk. formatted to ext4
$ sudo blkid showed the uuid of the diskscreated a mount point at /mnt/data1, and added the following entry to /etc/fstab
UUID=34c67677-ecd6-4bed-8f2a-a4a6ee54d425 /mnt/data1 ext4 defaults,errors=remount-ro 0 1 $ sudo mount -ato test. should now auto mount on startup had to chown the mount point from root to user, so user could use the new disk
to change browser for Thunderbird email links:
Edit -> Preferences -> Advanced -> Config Editor
Set to "true" the foll:
- network.protocol-handler.warn-external.http
- network.protocol-handler.warn-external.https
/usr/bin/google-chrome-stable
)Google Sketchup install
(see UbuntuHandbook blog)(see this for tweaks to not disable the ruby api)
$ sudo add-apt-repository ppa:ubuntu-wine/ppa $ sudo apt-get update $ sudo apt-get install wine1.7 $ winecfgDownloaded Sketchup Make 2014, installed the exe through Wine Progrm Loader. If hangs on starting up, might be because of ruby, so add " /DisableRubyAPI" to end of shortcut.Application:WindowsVersion:Windows7, Libraries:Override:"riched20"
Raid disk setup example:
wanted to do raid 0 install, (raid 0 just spreads across multiple disks, extra performance, no redundancy): had 2 identical 300G hard drives (sda, sdb) plan is to do the foll: sda partitions sdb partitions --------------- -------------- 2G, primary, beginnning, boot 2G, primary, beginnning, unmounted 2G, primary, end, swap<-------raid 0------>2G, primary, end, swap 150G, primary, end, root<-----raid 0------>150G, primary, end, root remaining, primary, home<-----raid 0------>remaining, primary, home creating boot drive:need to make boot drive, this cannot be raid (grub can't use raid?) sda -> free space -> create new partition -> Primary (try to keep at location beginning) use as -> ext4 journalling file system mount point -> boot -> done setting up partition creating matching non-raid partition on sdb (may not be necessary to do this, just doing it for symmetry) sda -> free space -> create new partition -> Primary -> location beginning use as -> ext4 journalling file system mount point -> do not mount -> done setting up partition creating swap raid: sda -> free space -> create new partition -> Primary -> location end use as -> physical volume for raid -> done setting up the partition [repeat for sdb] configure software raid -> write changes multi disk configuration -> create md device -> raid type raid 0 active devices -> (choose the 2 partitions created) multidisk configuration actions -> finish should now show RAID0 device. choose the #1 just under that, (and will be making that the swap partition) use as -> swap area done setting up partition creating root raid: same as swap raid, except, at the end, use as -> ext4 journalling file system mount point -> root file system -> done setting up partition creating home raid: same as root raid, except, at the end, use as -> ext4 journalling file system mount point -> home -> done setting up partition finish partitioning and write changes to disk write changes to disk (install process should now start) after installing, in ubuntu, System -> Administration -> System Monitor -> File System should show root and boot raid devices (swap won't be visible)
: