Skip to content

Instantly share code, notes, and snippets.

View DINKIN's full-sized avatar

DINKIN DINKIN

View GitHub Profile
@DINKIN
DINKIN / unfollow.js
Created November 28, 2015 17:50 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// 1. Go to https://twitter.com/following.
// 2. Keep scrolling to the bottom repeatedly until all your followers are loaded.
// 3. Run this in your console.
[].slice.call(document.querySelectorAll('.unfollow-text')).forEach(function(button) {
button.click();
});
@DINKIN
DINKIN / soundcloud.rb
Created February 2, 2016 10:57 — forked from arashm/soundcloud.rb
Simple script to downoad MP3 files from SoundCloud via WGet
#!/usr/bin/env ruby
require 'uri'
require 'httparty'
# Download mp3 files from SoundCloud
# Usage:
# ./soundcloud.rb https://soundcloud.com/tara-tiba/paeez_tara-tiba
class SoundCloud
include HTTParty
base_uri 'https://soundcloud.com'
@DINKIN
DINKIN / deployment-tool-ansible-puppet-chef-salt.md
Created February 9, 2016 10:28 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@DINKIN
DINKIN / hosts
Created February 20, 2016 06:56 — forked from sophistifunk/hosts
Hosts file additions to block tracking, ads, and evil
#general tracking sites, ad servers, and general evil pulled from chrome tracking graph plugin
127.0.0.1 buysellads.com
127.0.0.1 newrelic.com
127.0.0.1 polldaddy.com
127.0.0.1 quantserve.com
127.0.0.1 googlesyndication.com
127.0.0.1 google-analytics.com
127.0.0.1 chartbeat.com
127.0.0.1 netshelter.net
127.0.0.1 skimresources.com
@DINKIN
DINKIN / public-trackers.md
Created April 17, 2016 13:00 — forked from mcandre/public-trackers.md
List of public BitTorrent tracker announce URLs
@DINKIN
DINKIN / gist:c95243ba7bc5a750280acdd0da7f949c
Created July 18, 2016 21:55
CIDR SUBNET MASK CHEATSHEET & ICMP TYPE CODES
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
@DINKIN
DINKIN / problem with whitespace not being parsed by scanf; [Day 1: Data Types]
Last active August 13, 2016 22:59
problem with whitespace not being parsed by scanf; [Day 1: Data Types]
https://gist.github.com/DINKIN/23e00f01201f9ad07091ce370de04cbe
http://cboard.cprogramming.com/c-programming/125684-sscanf-need-include-spaces-character-string.html
%[^\n] is a scanf template specifier like %s.
%[] means all content containing characters in braces. You can use ascii ranges, eg, %[a-zA-Z0-9] will include everything alphanumeric, %[a-z!-/] will include small letters and most punctuation, %[ \t\n] will include spaces tabs and newlines.
%[^] is the inverse, it means all characters except this. %[^\n] -- everything up to the newline.
%[^NULL] aka, the "sawed off shotgun"
[03:36] <HackerRank1> <shashank> ok
[03:37] <HackerRank1> <shashank> string inp; getline(cin, inp);
@DINKIN
DINKIN / Day 1: Data Types [c strings white-space scanf].text
Created August 13, 2016 20:05
Day 1: Data Types [c strings white-space scanf]
https://gist.github.com/DINKIN/23e00f01201f9ad07091ce370de04cbe
http://cboard.cprogramming.com/c-programming/125684-sscanf-need-include-spaces-character-string.html
[03:36] <HackerRank1> <shashank> ok
[03:37] <HackerRank1> <shashank> string inp; getline(cin, inp);
[03:37] <HackerRank1> <shashank> that's 1 way
[03:37] <HackerRank1> <shashank> second is
[03:38] <HackerRank1> <shashank> vector string> line; while (cin > inp) line.push_back(inp);
[03:38] <HackerRank1> <shashank> another way is
<mra> ResortNet2: http://pastebin.com/raw/rtwbSf2D
int aaron;
double lewis;
char dinkin[55];
scanf("%d", &aaron);
scanf("%lf", &lewis);
scanf("%c", dinkin);
scanf("%[^\n]", dinkin);
@DINKIN
DINKIN / netmask_cidr.md
Created September 1, 2016 19:59 — forked from shamil/netmask_cidr.md
Netmask / CIDR Translation Table

Netmask / CIDR Translation Table

Netmask             Binary                              CIDR    Notes
---------------------------------------------------------------------------
255.255.255.255     11111111.11111111.11111111.11111111 /32     1   useable
255.255.255.254     11111111.11111111.11111111.11111110 /31     0   useable
255.255.255.252     11111111.11111111.11111111.11111100 /30     2   useable
255.255.255.248     11111111.11111111.11111111.11111000 /29     6   useable
255.255.255.240     11111111.11111111.11111111.11110000 /28     14  useable

255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable