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
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876 | |
// Copy following scripts in the developer console of page included markdown content you want to print: | |
(function () { | |
var $ = document.querySelector.bind(document); | |
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white'); | |
$('#readme>article').setAttribute('style', 'border: none'); | |
$('body').innerHTML = $('#readme').outerHTML; | |
window.print(); | |
})(); |
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 bash | |
set -e | |
username=$1 # github username | |
useradd $username | |
usermod -aG wheel $username | |
sudo -u $username /usr/local/bin/ghkeys.sh |
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 | |
import fractions | |
def utility(delta): | |
step = 0 | |
while True: | |
yield delta ** step | |
step += 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 python3 | |
import paramiko | |
def main(): | |
client = paramiko.client.SSHClient() | |
client.load_system_host_keys() | |
client.connect('share', username='vadim', compress=True) | |
result = exec_remote(client, 'procdata.py') |
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 | |
import argparse | |
import os | |
import subprocess | |
import sys | |
from collections import ChainMap | |
from pathlib import Path | |
from tempfile import TemporaryDirectory |
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/sh | |
# | |
# consul Consul Service Discovery Platform | |
# | |
# chkconfig: 2345 20 80 | |
# description: Consul is a tool for discovering and configuring services | |
# in your infrastructure. It provides several key features: | |
# * Service Discovery | |
# * Health Checking | |
# * Key/Valuye Store |
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
def sendThenApproveOrder(orderId, dateString) { | |
def config = grailsApplication.config | |
def refkey = config.co.mias.forms.services.refkey.toString() | |
def message = [ | |
'args': [refkey, orderId, dateString], | |
'task': 'milery.task.order.send_new_order', | |
'id': randomUUID() as String, | |
'callbacks': [ | |
[ | |
'immutable': 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
apt-get install libc6-dev libreadline-dev libz-dev libncursesw5-dev \ | |
libssl-dev libgdbm-dev libsqlite3-dev libbz2-dev liblzma-dev tk-dev |
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/python | |
import sys | |
import pystmark | |
API_KEY = 'API-KEY' | |
SENDER = 'Zabbix <[email protected]>' | |
def send(recipient, subject, body): | |
message = pystmark.Message(to=recipient, sender=SENDER, | |
subject=subject, text=body) |
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
var Crawler = require('crawler').Crawler | |
var fs = require('fs') | |
var base = 'http://www.utkonos.ru' | |
var start = base + '/' | |
var queued = {} | |
var crawledCount = 0 | |
var queuedCount = 0 | |
var canonical = function (url) { | |
var t1 = /^\/cat\/(\d+)\/?$/ |
NewerOlder