Skip to content

Instantly share code, notes, and snippets.

View pgaref's full-sized avatar

Panagiotis Garefalakis pgaref

View GitHub Profile
@pgaref
pgaref / gist:7ed87e47cd735a423e70
Last active September 18, 2018 10:10
Jmeter running out of addresses
java.net.NoRouteToHostException: Cannot assign requested address: JMeter server is unable to allocate a port to create a connection to the JMeter client to return the samples.
Same thing happened to Nginx front-end as well!
java.net.NoRouteToHostException: Cannot assign requested address
Otherwise, the following messages may appear in the JMeter JTL files:
Non HTTP response code: java.net.BindException
Non HTTP response message: Address already in use
The solution is to enable fast recycling TIME_WAIT sockets.
@pgaref
pgaref / gist:07ab9fa9b6208517a329
Created June 26, 2015 14:53
Kill a bunch of processes by name
for var in $(ps aux | grep ansible | awk '{print $2}'); do echo $var; sudo kill -9 $var; done
@pgaref
pgaref / ubuntu-java7n8
Last active November 9, 2015 19:53
Oracle Java 8 repository for Ubuntu distro
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
## Extra system conf
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo cp play-startup.sh /etc/init.d/
sudo update-rc.d play-startup.sh defaults
sudo update-rc.d -f play-startup.sh remove
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@pgaref
pgaref / gist:3cd7abbf7b1912718e41
Last active October 16, 2015 11:03
Install XCode Command Line tools on OSX
xcode-select --install
# Useful Bash commands
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r
@pgaref
pgaref / gist:57c17fc994123540fe62
Created October 19, 2015 20:35
GIT renaming a branch local & remote
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
sudo visudo
<username> ALL=NOPASSWD: ALL
@pgaref
pgaref / HostName and FQDN change
Last active October 31, 2015 14:44
Change linux hostname and Fully qualified domain name - linux
sudo nano /etc/hostname # For example: db01
sudo nano /etc/hosts # Example: 127.0.0.1 db01.example.com db01
sudo service hostname restart # Restart hostname service