Skip to content

Instantly share code, notes, and snippets.

@nestoru
nestoru / gist:3b23bd7dabccefcd48f7
Created February 6, 2015 14:29
Setting DISPLAY variable to avoid No protocol specified Error: Can't open display: :#
# Check current DISPLAY value
$ echo $DISPLAY
:0
# If xclock fails as below the variable is incorrect
$ xclock
No protocol specified
No protocol specified
Error: Can't open display: :0
# Find the correct value for the current user session
$ xauth list|grep `uname -n`
@nestoru
nestoru / SVN diff local agaist newer revision of resource
Last active August 29, 2015 14:11
SVN diff local agaist newer revision of resource
# Omit the path or use just "." to get full current directory differences
svn diff -r HEAD local/path/to/resource
# So it makes sense to use an alias for example in ~/.bash_profile in a MAC you could add:
alias svndiff="svn diff -r HEAD"
@nestoru
nestoru / Node https-to-https-proxy.js
Last active August 29, 2015 14:11
Node https-to-https-proxy.js
/*
- https-to-https-proxy.js: Tested with Apache as target host
- Preconditions: Have key/cert generated as in:
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out cert.csr
openssl x509 -req -days 3650 -in cert.csr -signkey key.pem -out cert.pem
*/
@nestoru
nestoru / ps aux with ppid
Created December 10, 2014 21:29
ps aux with ppid
ps aux|head -1
# Returns: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ps axo user,pid,ppid,pcpu,pmem,vsz,rss,tname,stat,start,time,args|head -1
# Returns: USER PID PPID %CPU %MEM VSZ RSS TTY STAT STARTED TIME COMMAND
@nestoru
nestoru / Secure Apache headers
Created December 7, 2014 14:02
Secure Apache headers
Header unset ETag
Header set X-Frame-Options: sameorigin
Header set X-XSS-Protection: "1; mode=block"
Header set X-Content-Type-Options: nosniff
Header set X-WebKit-CSP: "default-src 'self'"
Header set X-Permitted-Cross-Domain-Policies: "master-only"
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
@nestoru
nestoru / zaproxy REST API - list alerts for domain
Created December 5, 2014 21:54
zaproxy REST API - list alerts for domain
# use JSON(default), XML or HTM
http://zap/HTML/core/view/alerts/?zapapiformat=HTML&baseurl=http%3A%2F%2Fgoogle.com
@nestoru
nestoru / Ubuntu system proxy configuration - Chrome Browser proxy configuration
Last active August 29, 2015 14:10
Ubuntu system proxy configuration - Chrome Browser proxy configuration
gsettings set org.gnome.system.proxy mode 'none'
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.http host 0.0.0.0
gsettings set org.gnome.system.proxy.https port 8080
gsettings set org.gnome.system.proxy.https host 0.0.0.0
gsettings set org.gnome.system.proxy ignore-hosts "['']"
@nestoru
nestoru / Custom Java Multiple Dates Parser
Created December 5, 2014 17:12
Custom Java Multiple Dates Parser
/**
*
* See it in action in http://runnable.com/VIHI8AhI-_MpHcsM/multipledatesparser-java
*
* */
class MultipleDatesParser {
public static String stringToDate (String dateToParse) throws java.lang.Exception {
String parsedDate = null;
java.text.SimpleDateFormat sdf = null;
try {
@nestoru
nestoru / gist:a667afdbdfb01e0d2911
Last active August 29, 2015 14:10
log result for w3af version: 1.6.0.5, configuration: default top owasp 10 running against http://public-firing-range.appspot.com/
This file has been truncated, but you can view the full file.
version: 1.6.0.5
configuration: default top owasp 10
log: ./w3af_gui
Starting w3af, running on:
Python version: 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3]
GTK version: 2.24.10
PyGTK version: 2.24.0
w3af version:
w3af - Web Application Attack and Audit Framework
Version: 1.6.0.5
@nestoru
nestoru / Mount CIFS, SAMBA, SMB in MAC OS X
Created November 19, 2014 14:24
Mount CIFS, SAMBA, SMB in MAC OS X
sudo mount_smbfs '//domain;[email protected]/path/to/share/' /local/path/to/mounting/point