Accessing server infra

From stgo
Revision as of 12:02, 17 June 2015 by StefanS (Talk | contribs)

Jump to: navigation, search

>> return to Cedeus IDE


an intro can be found here

  • see what is installed dpkg -l
  • info on a particular package apt-cache show PackageName
    • the version of ssl can be obtained using sudo openssl version -a
  • upgrade apt-get upgrade PackageName or: sudo apt-get install libssl1.0.0

git stuff

  • git diff
  • git pull
  • git status
  • git reset --hard HEAD
  • git reset HEAD~1
  • git reset HEAD opentripplanner-api-webapp/src/main/java/org/opentripplanner/api/ws/analyst/
  • git log -p
  • git add opentripplanner-api-webapp/src/main/java/org/opentripplanner/api/ws/analyst/
  • git commit -m 'added debug code to be able to figure why some edges are traversed to fast (aside fromom u-shaped roads)'
  • gitk
  • git push origin master
  • git show-ref
  • git stash list
  • git log origin/master..master
  • git fetch upstream
  • git remote add upstream
  • git remote show origin
  • git remote set-url origin git://
  • git remote set-url origin
  • git diff > /Volumes/WINDOOF/walkingslopeeffects.patch
  • patch -p1 -R < IsoChrone2.patch
  • git apply --check /Volumes/WINDOOF/IsoChrone.patch

maven stuff

  • mvn package -DskipTests

postgres stuff

  • echo 'export PATH=/Library/PostgreSQL/9.2/bin:$PATH' >> ~/.bash_profile
  • psql
  • sudo mkdir /Library/PostgreSQL/9.2/data/
  • sudo chown postgres /Library/PostgreSQL/9.2/data/
  • sudo -u postgres initdb -D /Library/PostgreSQL/9.2/data/
  • service postgresql start
  • sudo -u postgres pg_ctl -D /Library/PostgreSQL/9.2/data -l logfile start
  • sudo -u postgres postgres -D /Library/PostgreSQL/9.2/data &
  • sudo -u postgres createdb santiagotest
  • sudo -u postgres createuser -P -s -e mentaer
  • psql santiagotest
  • to access via terminal use for instance psql -U sstein -d geonode -h localhost

using VirtualBox

  • a VM contains 3 files: .img + .vbox (an editable xml) + .vbox-prev
  • " use ssh -X sstein..@xxx to enable a visual client
  • vboxgtk (start visual client)

create and start a VM from comandline:

  • VBoxManage createvm --name ubuntu --register
  • VBoxManage modifyvm ubuntu --ostype ubuntu_64 --cpus 4
  • VBoxManage modifyvm ubuntu --memory 8000
  • VBoxManage startvm ubuntu


  • options of ip-addressing/web access: NAT (Network Address Translation) or Bridge (see also this blog entry)
  • downloading .iso archives/vm from OSGeo (use commands curl or wget -c), e.g.:
wget -c ""
  • showing list of running VMs: VBoxManage list runningvms
  • show list of VMs: VBoxManage list vms
  • powerdown a VM: VBoxManage controlvm opensuse132 poweroff
  • emergency power-off a VM that does not properly shutdown and when restarting there is a message such as:
VBoxHeadless: error: The machine 'opensuse132' is already locked for a session (or being unlocked)
VBoxHeadless: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
VBoxHeadless: error: Context: "LockMachine(session, LockType_VM)" at line 960 of file VBoxHeadless.cpp
=> solve with: VBoxManage startvm opensuse132 --type emergencystop


  • start with "sh"; use "&" at the end to keep the process running
  • make sure that winstone.jar is executable, with chmod 755
  • define in the file also where the webapps folder is located (physical location), so winstone knows that
  • define in the WEB-INF/classes/data-sources.xml file where the graph is stored (physical location) - the files is within /otp/webapps/opentripplanner-api-webapp.war (or: the deflated war folder)
  • kill winstone server (or OTP) process: use
    ps aux | grep winstone
    to find the associated PID, and use kill pid

Unix / Linux / Ubuntu commands

connect to server

  • ssh
  • ssh
  • transfer a file to a remote computer: scp /home/username/ftw.txt

see processes and find stuff

user management commands

memory related commands

other useful commands

Installing lightweight XFCE Desktop GUI on Ubuntu Server

  • use sudo apt-get install xubuntu-desktop to install XFCE client (see here).
  • this will also install xauth, which allows remote window clients
  • disable start of GUI-based login on system startup with Grub (taken from here):
    • Change (edit) in /etc/default/grub file: GRUB_CMDLINE_LINUX_DEFAULT="text"
    • then do sudo update-grub
  • start the desktop GUI session using startx
  • end the desktop GUI session using "logout" button

Enabling Remote Desktop for Windows

got the info from here

  • install XRDP: sudo apt-get install xrdp
  • connect via Windows Remote Desktop using the IP etc.
  • if not needed, switch off the remote desktop server using: sudo service xrdp stop

other stuff

  • gdalinfo cgydem_fromgrid.tif
  • if computer crashs: boot from a LiveDVD and the run fsck (see
  • compress:
    • files by using: zip fileToZip.obj
    • whole folders by using: tar -cvzf tarfilename.tgz /folder/to/compress
  • uncompress:
    • zip files, using: unzip,
    • bz2 files with: bunzip2 filename.bz2
    • tar files: tar -C / -xvzf tarfilename.tgz . Attention !!! This will restore the data exactly in the same place on the computer, and overwrite existing folders and files.
  • VBoxManage Windows 8 - 64bit createvm code : "Windows8_64"
  • start PhpStorm on my machine: sh ./dev/PhpStorm-133.1777/bin/
  • Installing New Harddisk in Ubuntu
  • install 7zip: sudo apt-get install p7zip-full
    • on how to use 7zip: see here and here
    • e.g. to pack: 7z a archivefile.7z archivetocompress.vdi