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 python3 | |
# -*- mode: python; coding: utf-8 -*- | |
import datetime | |
import threading | |
def test(n, use_thread=None): | |
if use_thread is None: | |
use_thread = 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
$ host -v 2chru.net 8.8.8.8 | |
Trying "2chru.net" | |
Using domain server: | |
Name: 8.8.8.8 | |
Address: 8.8.8.8#53 | |
Aliases: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6232 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 |
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
# -*- mode: python; coding: utf-8 -*- | |
assert str is not bytes | |
# DPI -- Deep Packet Inspection | |
def test_dpi(host, data): | |
import socket | |
ss = socket.create_connection((host, 80), timeout=10.0) | |
s = ss.makefile(mode='rwb') |
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/bash | |
# | |
# it is file -- /etc/ppp/ipv6-down.d/99-custom-internet.sh | |
# | |
if [ -z "$IFNAME" ] || [ "$LINKNAME" != "domru" ] | |
then | |
true | |
exit |
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
# -*- mode: sh; coding: utf-8 -*- | |
GOODZONE_FABRIC_WATERMARK_IMG=/home/regular-user/work/goodzone-fabric-convert/data/watermark.png | |
goodzone_fabric_convert_ico () { | |
mogrify -resize 160x160 "$@" | |
} | |
goodzone_fabric_convert_watermark () { | |
composite -compose atop -gravity center "$GOODZONE_FABRIC_WATERMARK_IMG" "$1" "$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
[root@localhost ~]# smartctl -a /dev/sda | |
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.12.1-3-ARCH] (local build) | |
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org | |
=== START OF INFORMATION SECTION === | |
Model Family: Intel 330/335 Series SSDs | |
Device Model: INTEL SSDSC2CT240A4 | |
Serial Number: CVKI3161041Q240DGN | |
LU WWN Device Id: 5 5cd2e4 0000bbc69 | |
Firmware Version: 335u |
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 python3 | |
# -*- mode: python; coding: utf-8 -*- | |
assert str is not bytes | |
import sys, os, os.path | |
if __name__ == '__main__': | |
for src_path in sys.argv[1:]: | |
src_name, src_ext = os.path.splitext(src_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
// -*- mode: cpp; coding: utf-8 -*- | |
// | |
// $ g++ -pedantic -std=c++11 -o test-py test-py.cpp $(pkg-config --cflags --libs python3) | |
// | |
#include <clocale> | |
#include <cstdlib> | |
#include <Python.h> | |
int main(int argc, char *argv[]) { |
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
# -*- mode: python; coding: utf-8 -*- | |
# | |
# Copyright 2013 Andrej Antonov <[email protected]>. | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 python2 | |
# -*- mode: python; coding: utf-8 -*- | |
from __future__ import absolute_import, print_function | |
assert unicode is not str | |
assert str is bytes | |
import sys, datetime |