Skip to content

Instantly share code, notes, and snippets.

@zero-master
zero-master / Facebook Iframe Breaker and Redirector
Created April 3, 2013 12:40
Facebook Iframe Breaker and Redirector
<script type="text/javascript">
if (top != self) top.window.location = 'http://URL-OF-DESTINATION-TAB';
</script>
@zero-master
zero-master / Prosper202 Offer Rotator and Tracker
Created April 3, 2013 12:44
Prosper202 Offer Rotator and Tracker
<?php
/*
-------------------------------------------------------------------------------------------------
Offer Link Rotation Script
Last edit: 2/25/2010
http://www.ctrtard.com
This script is designed to work with Prosper202
Parts ripped from Wes's landing page rotation script
@zero-master
zero-master / One More IP
Created April 3, 2013 12:45
Adding Addition IP to OVH
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
nano /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE="eth0:1"
BOOTPROTO="static"
IPADDR="142.4.223.247"
@zero-master
zero-master / SHORTCUTS
Created April 3, 2013 12:46
Centmin Mod install created command short cuts outlined here to allow you to quickly edit your /usr/local/lib/php.ini file and your /usr/local/etc/php-fpm.conf file. Full list of command shortcuts below:
Centmin Mod install created command short cuts outlined here to allow you to quickly edit your /usr/local/lib/php.ini file and your /usr/local/etc/php-fpm.conf file. Full list of command shortcuts below:
Edit php.ini = phpedit ( /usr/local/lib/php.ini )
Edit my.cnf = mycnf ( /etc/my.cnf )
Edit php-fpm.conf = fpmconf ( /usr/local/etc/php-fpm.conf )
Edit nginx.conf = nginxconf ( /usr/local/nginx/conf/nginx.conf )
Edit (nginx) virtual.conf = vhostconf - only edits /usr/local/nginx/conf/conf.d/virtual.conf not the additional vhost domain.com.conf files added later
Edit (nginx) php.conf = phpinc ( /usr/local/nginx/conf/php.conf )
Edit (nginx) drop.conf = dropinc ( /usr/local/nginx/conf/drop.conf )
Edit (nginx) staticfiles.conf = statfilesinc ( /usr/local/nginx/conf/staticfiles.conf )
@zero-master
zero-master / ping_pong.dart
Created March 28, 2014 16:11
Ping-Pong Server Socket-Socket Client implemetation for Dartlang.
import 'dart:io';
import 'dart:async';
main() {
ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 8000).then((s_server) {
s_server.listen((socket) {
socket.write('Ping!');
socket.listen((data){
print(new String.fromCharCodes(data));
sleep(new Duration(seconds:1));
@zero-master
zero-master / 0_reuse_code.js
Created April 1, 2014 19:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zero-master
zero-master / gist:9921261
Created April 1, 2014 19:27
Check if SSH Tunnel Started Successfully!
Use netcat -- often nc on Linux systems:
nc -dvzw10 ${HOSTNAME} 23
Works for me, with a response like:
Connection to ${HOSTNAME} 23 port [tcp/telnet] succeeded!
It also returns 0 on success, and is happy with a simple connection after which it goes away.
-d means not to read anything from the keyboard side
-v means to be verbose (turn this off in a script)
}).then((HttpResponse resp) {
var json = '';
if (resp.statusCode == 200) {
resp.transform(UTF8.decoder) // use a UTF8.decoder
.listen((String data) => json = json + data, // output the data
onError: (error) => print("UNABLE TO CONNECT"), onDone:() {
});
}
getJsonResponse(String target, Map params) {
params.addAll({
'client_id':this.client_id, 'api_key':this.api_key
});
var url = new Uri.http(API_HOST, target, params);
var client = new HttpClient();
client.userAgent = 'DoD v1.0';
print(url);
var url2 = Uri.parse('http://google.com');
@zero-master
zero-master / MongoDB Tracking Tool
Created May 6, 2014 09:28
MongoDB Tracking Tool
Daily Stats:
metadata: {
date: '...'
type: 'CAMPAIGN'
'ref':
}