Skip to content

Instantly share code, notes, and snippets.

Working from home

Peter Reisinger pete911

Working from home
View GitHub Profile
View find raspberry pi on the network
`sudo nmap -sP | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'` update `192.168.1.*` accordingly
pete911 / gist:0d2dfdd33a6cd16b2519
Created Sep 24, 2014
remove System-V script link
View gist:0d2dfdd33a6cd16b2519
sudo update-rc.d -f [app_name] remove
pete911 / ssh keys
Last active Aug 29, 2015
ssh key based authentication
View ssh keys
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa -b 4096 -f ~/.ssh/<key_name>
ssh-copy-id -i ~/.ssh/<key_name>.pub <username>@<host>
# add following entry to ~/.ssh/config file
Host <host|alias>
HostName <host|ip>
pete911 / knife-ec2
Last active Jan 4, 2016
chef - knife-ec2 setup
View knife-ec2
--- install rvm ---
# get and execute rvm and source it
curl -sSL | bash -s stable
source .rvm/scripts/rvm
# install ruby 2.1.0 and use it
rvm install ruby-2.1.0
rvm use 2.1.0
pete911 / Spring Resources
Last active Jan 3, 2016
Java - get resources from classpath
View Spring Resources
PathMatchingResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
Resource[] resources = resourceResolver.getResources("conf/**/*.properties");
Resource resource = resources[0];
pete911 / gist:6411270
Created Sep 2, 2013
key based authentication
View gist:6411270
ssh-keygen -t rsa
ssh-copy-id -i .ssh/ username:password@remotehost
pete911 / gist:6219918
Last active Dec 31, 2020
jenkins with private github projects
View gist:6219918
- login to jenkins box (ssh)
- switch user to jenkins "sudo su -s /bin/bash jenkins"
- go to jenkins home directory "cd ~"
- generate keys (you need separate pair per github private project as the projects are on the same domain)
- "ssh-keygen -t rsa -f ~/.ssh/id_rsa_<project>" (replace <project> with your project name)
- repeat this for every github project
- crate "config" file in .ssh dir - "vim ~/.ssh/config" with the following content:
# <project1>
pete911 / tomcat manager deploy
Last active Sep 2, 2021
tomcat - deploy war files using curl
View tomcat manager deploy
# deploy under "path" context path
curl --upload-file appplication-0.1-1.war "http://tomcat:tomcat@localhost:8080/manager/deploy?path=/application-0.1-1
# undeploy
curl "http://tomcat:tomcat@localhost:8080/manager/undeploy?path=/application-0.1-1"
# ! tomcat7 uses /manager/text/undeploy and /manager/text/deploy paths
# tomcat6-admin (debian) or tomcat6-admin-webapps (rhel) has to be installed
# tomcat-users.xml has to be setup with user that has admin, manager and manager-script roles
pete911 / big O
Created Jun 25, 2013
big O cheat sheet
View big O
pete911 / hiring hacks for startup
Created Jun 13, 2013
hiring hacks for startup
View hiring hacks for startup