Skip to content

Instantly share code, notes, and snippets.

@shamun
shamun / kannel.conf
Created October 29, 2021 08:05 — forked from srugano/kannel.conf
Example of Kannel configurations to be used with a Huawei modem.
# CONFIGURATION FOR USING SMS KANNEL WITH RAPIDSMS
#
# For any modifications to this file, see Kannel User Guide
# If that does not help, see Kannel web page (http://www.kannel.org) and
# various online help and mailing list archives
#
# Notes on those who base their configuration on this:
# 1) check security issues! (allowed IPs, passwords and ports)
# 2) groups cannot have empty rows inside them!
# 3) read the user guide
@shamun
shamun / iptables.sh
Created July 13, 2020 12:49 — forked from esmiz/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@shamun
shamun / curl.md
Created October 23, 2019 20:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@shamun
shamun / curl.md
Created October 23, 2019 20:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

on run
display dialog "This script applet will respond to webpage links beginning with:" & return & return & "customurl://com.hackademic.AppleScript.URL_Handler?action=1$Path/to/PDF.pdf#" & return & return & "It will open your custom URLs in Skim" buttons {"OK"} default button 1 with title "Custom URL Helper" with icon 1
tell application "Finder" to update (path to me)
end run
on open location this_URL
-- EXTRACT ARGUMENTS
set X to the offset of "?" in this_URL
# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
mylib.close_to_tray = ->
gui = require('nw.gui')
win = gui.Window.get()
tray = null
win.on 'close', ->
this.hide()
tray = new gui.Tray({ icon: 'icon.jpg' })