Skip to content

Instantly share code, notes, and snippets.

Avatar
🖥️
Netflix and Chill

Z. Jiang SharkIng

🖥️
Netflix and Chill
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am sharking on github.
  • I am sharking (https://keybase.io/sharking) on keybase.
  • I have a public key ASCgOxMQLCOt8FonsxaFodhui_n_ICrnvI_x9xIfO9XDQQo

To claim this, I am signing this object:

View press.one
{"sig":"ab27294e1b324b1388388f39cebdd252f71a7b7de5d94fe299a4914f1f9b57b52140f2fcc5eeba6e21c8790502a56cd138621686edefa4f7decd9bacf38f99c81","msghash":"dca22a797cd47ddeae2ab5e4050bae2e6938a1f67a9f9ae95599a4efabae5946"}
@SharkIng
SharkIng / gencert.sh
Created Sep 28, 2015
Gen Self Sign Cert
View gencert.sh
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
@SharkIng
SharkIng / pptp_install.sh
Created Nov 19, 2014
PPTP VPN 安装脚本
View pptp_install.sh
#!/bin/bash
type pptpd > /dev/null 2>&1
[ $? -ne 0 ] && apt-get install pptpd
grep '^localip 192.168.' /etc/pptpd.conf > /dev/null
if [ $? -ne 0 ]; then
cat >> /etc/pptpd.conf <<PPTPDCONF
localip 192.168.17.1
remoteip 192.168.17.11-60
View gist:2b86024180b2a5e93e6a
import java.io.IOException;
import java.util.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;
public class Mappers extends Mapper<LongWritable, Text, Text, IntWritable> {
@SharkIng
SharkIng / Logcat
Created Mar 6, 2014
Android LogCat
View Logcat
03-06 00:07:53.227: D/dalvikvm(904): GC_FOR_ALLOC freed 230K, 13% free 2748K/3140K, paused 34ms, total 37ms
03-06 00:07:53.227: I/dalvikvm-heap(904): Grow heap (frag case) to 3.445MB for 635812-byte allocation
03-06 00:07:53.347: D/dalvikvm(904): GC_FOR_ALLOC freed 4K, 11% free 3364K/3764K, paused 116ms, total 116ms
03-06 00:07:53.387: D/dalvikvm(904): GC_FOR_ALLOC freed <1K, 11% free 3364K/3764K, paused 32ms, total 33ms
03-06 00:07:53.387: I/dalvikvm-heap(904): Grow heap (frag case) to 3.917MB for 500416-byte allocation
03-06 00:07:53.509: D/dalvikvm(904): GC_FOR_ALLOC freed <1K, 10% free 3852K/4256K, paused 109ms, total 109ms
03-06 00:07:53.606: E/SQLiteLog(904): (1) near "tabletasksdatabase": syntax error
03-06 00:07:53.616: D/AndroidRuntime(904): Shutting down VM
03-06 00:07:53.616: W/dalvikvm(904): threadid=1: thread exiting with uncaught exception (group=0x41465700)
03-06 00:07:53.638: E/AndroidRuntime(904): FATAL EXCEPTION: main
View firewall.sh
#! /bin/bash
# Set the default policies to allow everything while we set up new rules.
# Prevents cutting yourself off when running from remote SSH.
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush any existing rules, leaving just the defaults
iptables -F
View Changeling1
import WordLookup
def changeling(initial,goal,steps):
first=initial
last=goal
### The Word Check Function Part ###
if WordLookup.lookup(initial) == False or WordLookup.lookup(goal) == False:
return "Not in the List"
View Changeling2
from WordLookup import lookup
# This is a helper function which converts a word string into a list with each letter as an element
def wordToList(word):
i=0
a=[]
while i < len(word):
a.append(word[i])
i+=1
return a
@SharkIng
SharkIng / gist:6590194
Created Sep 17, 2013
Error install puppet
View gist:6590194
Selecting previously unselected package pe-ruby-shadow.
Unpacking pe-ruby-shadow (from .../pe-ruby-shadow_2.2.0-1puppet3_amd64.deb) ...
Selecting previously unselected package pe-puppet.
Unpacking pe-puppet (from .../pe-puppet_3.2.4.pe1-1puppet1_all.deb) ...
Selecting previously unselected package pe-rubygem-guid.
Unpacking pe-rubygem-guid (from .../pe-rubygem-guid_0.1.1-1puppet2_all.deb) ...
Selecting previously unselected package pe-rubygem-builder.
Unpacking pe-rubygem-builder (from .../pe-rubygem-builder_3.0.0-1puppet2_all.deb) ...
Selecting previously unselected package pe-rubygem-excon.
Unpacking pe-rubygem-excon (from .../pe-rubygem-excon_0.14.1-1puppet2_all.deb) ...
You can’t perform that action at this time.