Skip to content

Instantly share code, notes, and snippets.

View nielsvanderbeke's full-sized avatar

Niels Vanderbeke nielsvanderbeke

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nielsvanderbeke on github.
  • I am nielsvanderbeke (https://keybase.io/nielsvanderbeke) on keybase.
  • I have a public key whose fingerprint is EDE2 92B4 0AA7 9958 D823 4EE5 15EC DC89 DBB8 02A7

To claim this, I am signing this object:

Kill all running containers
docker kill $(docker ps -q)
Delete all stopped containers (including data-only containers)
docker rm $(docker ps -a -q)
Delete all ‘untagged/dangling’ (<none>) images
@nielsvanderbeke
nielsvanderbeke / wtfpl
Created February 25, 2015 08:41
Do What The Fuck You Want To Public License
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nielsvanderbeke
nielsvanderbeke / links_vsphere
Last active June 7, 2022 22:24
VMware install ISO on USB
/**
* Access Flukso API server returning a JSON
*
*/
function getJSON(sensor, token, query) {
var sheetname = "test";
//var aUrl = "http://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?version=1.0&token=d8a8ab8893ea73f768b66b45234b5c3a&interval=month&unit=watt";
var api="1.0";
var aUrl = "http://api.flukso.net/sensor/"+sensor+"?version="+api+"&token="+token+query;
@nielsvanderbeke
nielsvanderbeke / weblogic SSL problem
Created April 22, 2014 09:40
weblogic SSL problem
http://www.ateam-oracle.com/improve-ssl-support-for-your-weblogic-domains/
pattern="smtp"
for jar in /usr/share/java/*.jar; do
for file in $(unzip -l $jar | perl -nle 'split /\s+/ and print $_[-1];'); do
unzip -c $jar $file | grep -qi "$pattern" && (
rpm -qf $jar 2>&1 >/dev/null && \
rpm -qf $jar || \
echo "orphan jar: $jar"
);
done
done | sort -u
@nielsvanderbeke
nielsvanderbeke / httpd_carto.sh
Created March 17, 2014 08:43
script to get carto of all httpd installs on machine
#!/bin/ksh
echo "hostname;location;process owner;server version;server build;server mulde magic number;server loaded;comiled using;architecture;server MPM;threaded;forked;verbose compile info;modules"
http_bins=`ps -eaf | grep -v grep | grep httpd | awk '{ print $8 }' | sort | uniq`
for http_version in $http_bins ; do
http_build=`${http_version} -V`
http_owner=`ps -eaf | grep -v grep | grep ${http_version} | awk '{ print $1 }' | sort | uniq`
http_serverVersion=`echo -e "${http_build}" | grep "Server version" | awk '{ {print $3,$4} }'`
@nielsvanderbeke
nielsvanderbeke / count_java_threads
Created March 17, 2014 06:54
count threads all java processes
ps -eLF | awk '{ { print $1,$13,$14 } }' | grep java | grep -v grep| sort | uniq -c
==== ps ====
-e Select all processes. Identical to
-F extra full format. See the -f option, which -F implies.
-L Show threads, possibly with LWP and NLWP columns
==== uniq ====
-c, --count prefix lines by the number of occurrences
@nielsvanderbeke
nielsvanderbeke / Apache_Hardening.md
Created February 26, 2014 08:15
Security by obscurity APACHE

Problem

HTML comments can expose information about the system where the webpages run.

Solution 1

ExtFilterDefine strip_comments remove_comments mode=output \
	intype=text/html cmd="/bin/sed s/\<\!--.*--\>//g"
<LocationMatch /cgi-bin/wm*>

SetOutputFilter remove_comments