Skip to content

Instantly share code, notes, and snippets.

View user454322's full-sized avatar
💭
I may be slow to respond.

Javier user454322

💭
I may be slow to respond.
View GitHub Profile
netcat
user@server$ cat /tmp/oom-heapdump | nc -l 9741
me@local$ nc server.com 9741 > oom-heapdump
@user454322
user454322 / git
Last active February 8, 2017 07:51
My git commands
Status between branches
git diff --name-status master..branch_name
Merging while ignoring some files
git merge --no-commit --no-ff branch_name
git reset /path/to/ignored
Tags
@user454322
user454322 / openssl_android_v.sh
Created September 12, 2014 11:23
Find out which OpenSSL version is used in each version of Android
#!/bin/sh
#git clone https://android.googlesource.com/platform/external/openssl
for ANDROID_TAG in $(git ls-remote --tags| colrm 1 48| grep -v "\^{}")
do
git checkout "$ANDROID_TAG"
OPENSSL_V="$(cat openssl.version)"
echo "[$OPENSSL_V] - [$ANDROID_TAG]" >> openssl.versions
done
@user454322
user454322 / unix_notes
Last active August 23, 2016 09:12
UNIX notes
grep -v “^$” filename > newfilename
#Remove special characters from a file
cat "$f" | tr -dc ' [:alnum:]\n\r' | tr '[:upper:]' '[:lower:]'
lsof -P -i -n
tcpdump -i eth0 host 192.168.1.1
@user454322
user454322 / mode_stat.c
Created June 21, 2014 01:32
umask chmod open
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#define RW_UGO (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH| S_IWOTH)
int
main(int argc, char **argv, char **env) {
@user454322
user454322 / svndiff_helper
Last active August 29, 2015 14:01
This is a simple wrapper intended for use with the --diff-cmd argument of 'svn diff'
#!/usr/bin/python
# Forked from:
# https://github.com/c4rlo/Subversion-scripts/blob/master/svndiff_helper
#
# The easiest way to use this script is by setting
# diff-cmd = svndiff_helper
# in section [helpers] in your ~/.subversion/config.
import sys, re, subprocess, os, os.path
@user454322
user454322 / openssl_selfsigned
Last active September 27, 2016 04:36
Script to create SSL self signed certificate
#!/usr/bin/env bash
set -o errexit
## Functions
function usage(){
echo "Usage: $0 -d <domain> [-t <time_in_days>]"
}
mvn clean javadoc:jar source:jar deploy
bin/catalina.sh jpda start
@user454322
user454322 / threads.rb
Last active August 29, 2015 13:55
Simple Ruby program to test threads
def sub1
i=0
while
i = rand(10) + i
#puts "In thread"
end
end
th = Thread.new{sub1}
th1 = Thread.new{sub1}
#!/bin/bash
# Prints information about the Java threads that consumes most of the CPU
# Derived from the information given in the blog entry at
#
# http://nurkiewicz.blogspot.be/2012/08/which-java-thread-consumes-my-cpu.html
#
# Changelog:
#
# - Removed the `top', `perl', and `grep' dependencies.