Skip to content

Instantly share code, notes, and snippets.

#! /bin/sh
### BEGIN INIT INFO
# Provides: graylog-collector
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: graylog-collector init script
# Description: graylog-collector init script
### END INIT INFO
@ibuys
ibuys / JavaScript Blacklist
Created February 25, 2016 20:58 — forked from gruber/JavaScript Blacklist
My list of blocked sites for use with Drew Thaler's JavaScript Blacklist extension for Safari (https://code.google.com/p/jsblacklist/downloads/list)
adclick.g.doubleclick.net, addthis.com, adgardener.com, adnxs.com, ads.pointroll.com, ads.shorttail.net, apture.com, bop.fm, cdn.taboolasyndication.com, chartbeat.com, chartbeat.net, d1.openx.org, doubleclick.net, doubleverify.com, exitjunction.com, fyre.co, getconnected.southwestwi-fi.com, googleadservices.com, gravity.com, grvcdn.com, imrworldwide.com, intellitxt.com, jetpackdigital.com, kontera.com, livefyre.com, luminate.com, meebo.com, moovmanage.com, outbrain.com, parsely.com, po.st, pointroll.com, pubmatic.com, quantserve.com, s.ppjol.net, scorecardresearch.com, serving-sys.com, sharethis.com, snap.com, superclick.com, taboola.com, taboolasyndication.com, tynt.com, wibiya.com
@ibuys
ibuys / inline2ref.rb
Created February 25, 2016 21:48 — forked from gruber/inline2ref.rb
Convert inline Markdown links to references
#!/usr/bin/env ruby
def e_sh(str)
str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''")
end
def find_headers(lines)
in_headers = false
lines.each_with_index {|line, i|
if line =~ /^\S[^\:]+\:( .*?)?$/
@ibuys
ibuys / Liberal Regex Pattern for Web URLs
Created February 25, 2016 21:48 — forked from gruber/Liberal Regex Pattern for Web URLs
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@ibuys
ibuys / Paste URL From Safari Tab.scpt
Created February 25, 2016 21:50 — forked from gruber/Paste URL From Safari Tab.scpt
Paste URL From Safari Tabs
set _old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {""}
tell application "System Events"
set _current_app to name of the first process whose frontmost is true
end tell
tell application "Safari"
set _urls to {}
repeat with i from 1 to 6 -- how many Safari windows to show URLs from
@ibuys
ibuys / cognito-developer-authenticated-client-example.py
Created December 12, 2016 16:59 — forked from dkarchmer/cognito-developer-authenticated-client-example.py
django-boto3-cognito: AWS' Cognito Developer Authenticated Identities Authflow using Django/Python/Boto3 (For building stand-alone clients)
__author__ = 'dkarchmer'
'''
This script emulates a stand-alone Python based client. It relies on Boto3 to access AWS, but
requires your Django server to have an API for your user to access Cognito based credentials
Because of Cognito, the client (this script) will only get temporary AWS credentials associated
to your user and only your user, and based on whatever you configure your AIM Policy to be.
Most Cognito examples demonstrate how to use Cognito for Mobile Apps, so this scripts demonstrate
how to create a stand-alone Python script but operating similarly to these apps.
@ibuys
ibuys / gist:0f9820c90ad5d5df7bf6ec4d5f1fe5ce
Created December 20, 2016 23:50 — forked from psilva261/gist:dede25e29198d58c5728
Convert p7b file to pfx file (to use Godaddy SSL/TLS Certificate for Azure Websites)
# Required files:
# .crt and .p7b: provided by Godaddy when exporting
# .key: self-generated file that was needed to create CSR (Certificate signing request)
#
# Note: this password has nothing to do with the password entered to create the CSR.
# It will be checked once the pfx is uploaded to Azure.
$ openssl pkcs12 -export -in www.mydomain.com.crt -inkey www.mydomain.com.key -certfile www.mydomain.com.p7b -out www.mydomain.com.pfx
Enter Export Password:
Verifying - Enter Export Password:
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" You will load your plugin here
" Make sure you use single quotes
" Initialize plugin system
Plug 'tomtom/tcomment_vim'
Plug 'ctrlpvim/ctrlp.vim'
@ibuys
ibuys / youtube-dl.md
Created October 22, 2020 21:11 — forked from harishkannarao/youtube-dl.md
youtube-dl

youtube-dl

youtube-dl is an opensource command line tool to download video or audio from online video streaming services.

Videos downloaded in mkv or webm extensions can be played by VLC Media player in all major devices and operating systems including iPhone, Android devices.

Tool website: https://youtube-dl.org/

This gist shows the example commands to use the tool and doesn't support or encourage piracy or violation of copyrights of the online streaming service or the author of the content

Installing youtube-dl:

@ibuys
ibuys / center_window.applescript
Created November 2, 2016 19:01
Applescript to Center a Window
tell application "Finder"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
set screenHeight to item 4 of screenSize
end tell
property WP : 0.1 -- prop of w free screen we want
property HP : 0.02 -- prop of w free screen we want