Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
/**
* Module dependencies.
*/
var Promise = require('bluebird');
var AWS = require('aws-sdk');
var config = require('../config');
var awsConfig = {region: 'eu-west-1', apiVersion: '2010-03-31'};
awsConfig.accessKeyId = config.sns.accessKeyId;
awsConfig.secretAccessKey = config.sns.secretAccessKey;
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: NGINX is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@DeviaVir
DeviaVir / .gpg-rescue.sh
Created September 24, 2015 11:56
Intermittent problems with gpg and a NEO key? And you need it to work NOW? Use this.
#!/bin/bash
echo "kill gpg-agent"
code=0
while [ 1 -ne $code ]; do
killall gpg-agent
code=$?
sleep 1
done
ch.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
# block specific user agents used for evil
if ($http_user_agent ~* "Purebot|Lipperhey|MaMa CaSpEr|libwww-perl|Mail.Ru|gold crawler|morfeus fucking scanner|ZmEu") {
return 403;
}
# Secure WP-login a bit better
set $blockemptyuseragent C;
if ($http_user_agent = '') {
set $blockemptyuseragent A;
}
@DeviaVir
DeviaVir / sequelize.js
Created May 20, 2015 16:25
little moment/where example :)
where: {
created_at: {
$between: [
moment().subtract(averageInDays, 'days').format('YYYY-MM-DD HH:mm:ss'),
moment().format('YYYY-MM-DD HH:mm:ss')
]
}
}
# Run deploy
- command: "echo `date +%s`"
register: timestamp
- command: "/usr/bin/sh /root/deploy.sh master release {{ timestamp.stdout }}"
async: 600
poll: 10
@DeviaVir
DeviaVir / svn_revert+rm
Created May 8, 2015 10:12
Revert and remove abundant files.
svn st | grep ^D | cut -c9- | xargs svn revert
svn st | grep ! | cut -c9- | xargs svn rm
05-05 14:51:45.123: W/System.err(26850): javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
05-05 14:51:45.124: W/System.err(26850): at com.android.org.conscrypt.SSLNullSession.getPeerCertificates(SSLNullSession.java:104)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:98)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:393)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:170)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)
05-05 14:51:45.124: W/System.err(26850): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirec
$ cd /tmp; npm i dtrace-provider
\
> [email protected] install /private/tmp/node_modules/dtrace-provider
> node scripts/install.js
---------------
Building dtrace-provider failed with exit code 1 and signal 0
re-run install with environment variable V set to see the build output
---------------
[email protected] node_modules/dtrace-provider