Skip to content

Instantly share code, notes, and snippets.

Avatar

Wim Mostmans Sitebase

View GitHub Profile
View form.html
<script>
// Send cookie data to hacker
alert('Thanks for your cookies:' + document.cookie);
</script>
@Sitebase
Sitebase / public_get.sublime-snippet
Last active Aug 29, 2015
Handy PHP snippets for creating getters and setters
View public_get.sublime-snippet
<snippet>
  <content><![CDATA[
public function get${1:Property}() {
  return \$this->${2:$property};
}
]]></content>
  <tabTrigger>publicget</tabTrigger>
  <scope>source.php</scope>
</snippet>
@Sitebase
Sitebase / README.md
Last active Aug 29, 2015
OpenWRT Config files
View README.md

Monitor syslog

  • logread -f
  • logread -f | nc 192.168.1.1 514

Sniff data on network through OpenWRT router

You can run this command on your local computer and it will run the tcpdum on the router. The dump.txt file will be written back to your local computer.

ssh -x root@192.168.1.1 tcpdump port http or port ftp or port smtp or port imap or port pop3 -l -A -i br-lan > dump.txt

@Sitebase
Sitebase / run.sh
Created Aug 27, 2014
Script to generate all the different cover and icon sizes needed for an iPad app
View run.sh
# How to use:
# 1. Make sure you have a large version of the landscape cover and protrait cover and one large version of the icon
# 2. Put them in the same folder as this script, also add a dist folder, so the folder will look like:
# ipad-landscape.png
# ipad-portrait.png
# icon.png
# thisscript.sh
# dist
# 3. Now run thisscript.sh and the result will be available in the dist folder
log ()
View cf-ddns.sh
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Update: changed because the old IP-service wasn't working anymore
# Uses curl to be compatible with machines that don't have wget by default
# modified by Ross Hosman for use with cloudflare.
#
# Place at:
# /usr/local/bin/cf-ddns.sh
# if you're lazy (like me): curl https://gist.githubusercontent.com/larrybolt/6295160/raw/9efbc7850613e06db1b415bdf4fbdd8361209865/cf-ddns.sh > /usr/local/bin/cf-ddns.sh && chmod +x /usr/local/bin/cf-ddns.sh && vim /usr/local/bin/cf-ddns.sh
# run `crontab -e` and add next line:
View cf-ddns.sh
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Update: changed because the old IP-service wasn't working anymore
# Uses curl to be compatible with machines that don't have wget by default
# modified by Ross Hosman for use with cloudflare.
#
# Place at:
# /usr/local/bin/cf-ddns.sh
# if you're lazy (like me): curl https://gist.githubusercontent.com/Sitebase/8552675cb5401fb42791/raw/e646241fd4fc14a0736eab6b5422ba97a3c1d242/cf-ddns.sh > /usr/local/bin/cf-ddns.sh && chmod +x /usr/local/bin/cf-ddns.sh && vim /usr/local/bin/cf-ddns.sh
# run `crontab -e` and add next line:
@Sitebase
Sitebase / module.js
Created Oct 7, 2014
Example of a custom JavaScript module for the BuboBox widget. This module will add an extra popup menu item with some custom text.
View module.js
/**
* This is an example BBBX widget module
* It can be used to add additional functionallity to the BuboBox platform in a modularized way
*/
window.bbbx_modules = window.bbbx_modules || []; // Make modules array if not yet exists
window.bbbx_modules.push(function(sandbox, $) {
var NAME = 'custommodule';
/**
@Sitebase
Sitebase / bbbx-form-callback.js
Last active Aug 29, 2015
BuboBox Javascript module that will post the user submitted form data to your server.
View bbbx-form-callback.js
/**
* BuboBox form callback module
*
* @author Wim Mostmans (wim@bubobox.com)
* @license BSD
*
* Copyright (c) 2014 BuboBox
*/
window.bbbx_modules = window.bbbx_modules || []; // Make modules array if not yet exists
window.bbbx_modules.push(function(sandbox, $) {
@Sitebase
Sitebase / bbbx-login-stack.js
Last active Aug 29, 2015
Let users login with their custom account before they can submit an entry.
View bbbx-login-stack.js
/**
* BuboBox form callback module
*
* @author Wim Mostmans (wim@bubobox.com)
* @license BSD
*
* Copyright (c) 2014 BuboBox
*/
window.bbbx_modules = window.bbbx_modules || []; // Make modules array if not yet exists