This file contains 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
.active { | |
font-weight: bold; | |
color: red; | |
} |
This file contains 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
class MyHTTP < Net::HTTP | |
def on_connect() | |
@socket.io.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) | |
end | |
end | |
n = 5 | |
host = 'example.com' | |
port = 80 |
This file contains 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
# This file is generated from information provided by the datasource. Changes | |
# to it will not persist across an instance reboot. To disable cloud-init's | |
# network configuration capabilities, write a file | |
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: | |
# network: {config: disabled} | |
network: | |
ethernets: | |
eth0: | |
dhcp4: true | |
optional: true |
This file contains 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 waitForHead(cb) { | |
const waiter = setInterval(function() { | |
if(document.head) { | |
clearInterval(waiter); | |
cb(); | |
} | |
}, 0); | |
} |
This file contains 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(){ | |
const d=document; | |
const css = d.createElement('style'); | |
css.innerText = ` | |
.ymb { | |
position: fixed; | |
bottom: 0; | |
left: 0; | |
right: 0; |
This file contains 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
# ~/.ssh/rc | |
chat='<chat_id>' | |
token='<token>' | |
msg="*SSH $(uname -n)* | |
\`\`\` | |
User: ${USER} | |
Remote IP: ${SSH_CONNECTION%% *} | |
\`\`\` |
This file contains 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 | |
from collections import Counter | |
from re import findall | |
from sys import argv | |
def main(text, top, n=2): | |
ngrams = [] | |
for word in findall(r'\w+', text.lower()): | |
wlen = len(word) |
This file contains 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 | |
from socket import gethostbyname, socket | |
from ssl import wrap_socket | |
from sys import argv | |
from time import time | |
from urllib.parse import urlparse | |
def main(url): | |
pu = urlparse(url) |
This file contains 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 | |
from socket import AF_INET, IPPROTO_ICMP, SOCK_DGRAM, gethostbyname, socket | |
from struct import pack | |
from time import sleep, time | |
def main(): | |
seq = 1 | |
with socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) as s: | |
s.settimeout(1) |
This file contains 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
"""Global (WAN) IP generator""" | |
from random import randint | |
from socket import inet_ntoa | |
from struct import pack | |
__author__ = 'Mikhail Yudin aka fagci' | |
def global_ip_generator(count=10): | |
while count: |