Skip to content

Instantly share code, notes, and snippets.

@adini121
adini121 / README.md
Last active August 27, 2015 17:54 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@adini121
adini121 / gist:3b2cc83b5ec787c9f18b
Last active August 27, 2015 18:31 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@adini121
adini121 / ElasticSearch.sh
Last active September 4, 2015 07:26 — forked from gourneau/ElasticSearch.sh
Elastic Search 1.4.2 with Oracle Java 8
### Install Oracle Java 8, this means you agree to their binary license!!
cd ~
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo aptitude -y install oracle-java8-installer
### Download and Install ElasticSearch
@adini121
adini121 / gist:ad11c65d03bc5d2370d6
Created September 22, 2015 16:46 — forked from tonymtz/gist:714e73ccb79e21c4fc9c
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@adini121
adini121 / tmux_local_static_install.sh
Last active October 13, 2015 09:00 — forked from haridsv/tmux_local_static_install.sh
Bash script for installing tmux without root privileges. Simply download, give exec permissions and run.
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.0
@adini121
adini121 / git_repo_creation.sh
Last active October 3, 2015 17:20
Create a new repository locally AND add remote too (e.g. create a remote repository at github from local one)
#! /bin/bash
# Description
# Author: Adi
# ChangeLog:
# Date: 29.08.15
repo=$1
git init
@adini121
adini121 / Useful_git_commands.md
Last active January 28, 2016 12:59
Useful git commands I encountered throughout my experience with Git

##Git commands I encountered throughout my git-experience

####Best Git practices

  1. Always review what's in the staging area before commiting to make sure you would only add/commit whats intended to be committed -> Saves you from pushing undesired objects to remote.
git status | git diff --cached
  1. Always fetch from remote before working in order to avoid (future) conflicts ####Regular git workflow for creating/adding/committing/pushing new files to (remote) repository
@adini121
adini121 / Useful_bash_commands.md
Last active July 6, 2016 12:19
Commands for CLI and bash scripting

Cleanup after jenkins

	rm -rf $(ls -la | grep -E 'nisal.*slave*' | awk '{print $9}')
	rm -rf $(ls -la | grep -E 'nisal.tmp' | awk '{print $9}')
	rm -rf $(ls -la | grep -E '*nisal*.*._.*' | awk '{print $9}')
	rm -rf $(ls -la | grep -E '*nisal*.*tool*' | awk '{print $9}')
	
	kill $(ps aux | grep -E 'nisal.*java -jar /tmp*' | awk '{print $2}')
	kill $(ps aux | grep -E 'nisal.*slave*' | awk '{print $2}')
	kill $(ps aux | grep -E '/usr/lib/jvm/java.*TomcatInstance*' | awk '{print $2}')
@adini121
adini121 / apache_httpd_install.md
Last active September 18, 2022 08:30
Install Apache server without root privileges : The definitive guide (Linux/Unix only)

A definitive guide for installing Apache-httpd server without root privileges | Only for unix-like systems

During the work of my thesis I had to run php based applications on a linux server where I had no root privileges. Hence I dug up on the web and I present to you

a way to install apache httpd at any desired location.

./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache 
--enable-deflate --enable-expires --enable-headers --enable-usertrack 
--enable-cgi --enable-rewrite --enable-so --enable-vhost-alias  
--with-apr=/home/nisal/apache/httpd-2.4.17/srclib/apr-1.5.2/ --with-apr-util=/home/nisal/apache/httpd-2.4.17/srclib/apr-util-1.5.4/ 
--prefix=/home/nisal/apache/httpd-2.4.17/ 
@adini121
adini121 / expecting.md
Created October 31, 2015 10:48 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect