This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IPT=iptables | |
del() { | |
table=$1 | |
$IPT -t $table -F | |
$IPT -t $table -X | |
$IPT -t $table -Z | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Traverse file system | |
*/ | |
private int calcDepth(string path) => System.IO.Path.GetFullPath(path).Split(System.IO.Path.DirectorySeparatorChar).Length; | |
public void scanDirectory(string path, int maxDepth=1) | |
{ | |
// assert `path` is directory | |
System.Diagnostics.Debug.Assert(System.IO.Directory.Exists(path)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Generated iptables firewall script for the Linux 2.4 kernel | |
# Script generated by Easy Firewall Generator for IPTables 1.15 | |
# copyright 2002 Timothy Scott Morizot | |
# | |
# Redhat chkconfig comments - firewall applied early, | |
# removed late | |
# chkconfig: 2345 08 92 | |
# description: This script applies or removes iptables firewall rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = KaiserKatze | |
email = [email protected] | |
[core] | |
editor = vim | |
autocrlf = true | |
whitespace = trailing-space,space-before-tab | |
alias = adda | |
[color] | |
ui = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cook iptables | |
apt-get -y install build-essential automake libtool | |
git clone git://git.netfilter.org/iptables | |
cd iptables | |
./autogen.sh | |
./configure | |
make | |
make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printerr() { echo "$@" 1>&2; } | |
get_host_ip() { | |
adapters=$(ip -4 a | awk '/inet/{print $2}' | cut -d'/' -f1) | |
for adapter in $adapters; | |
do | |
# exclude address of loopback interface | |
if [ "$adapter" == 127.0.0.1 ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class Angle: | |
val = 0 | |
def __init__(self, x, y, z): | |
self.val = ((x * 60) + y) * 60 + z | |
self.x = x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Travis CI configuration | |
language: generic | |
sudo: required | |
dist: trusty | |
# DO NOT CACHE DEBIAN PACKAGES | |
before_install: | |
- pwd | |
- git clone --quiet --branch 3.7 --depth 1 --no-tags -- https://github.com/python/cpython cpython-3.7 | |
- cd cpython-3.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class Solution: | |
def __init__(self): | |
self.array = None | |
def create_array(self, array_length): | |
result = [0] * array_length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extractTotalViewFromHtmlResponse(response) { | |
// TODO | |
} | |
// test mid=299999920 | |
// test mid=6290510 | |
export class User { | |
User(mid: number) { | |
} |