Skip to content

Instantly share code, notes, and snippets.

View xmonader's full-sized avatar
🏠
Working from home

xmonader xmonader

🏠
Working from home
View GitHub Profile
# nim_parsec
# Copyright xmonader
# parsec for nim
import options, strformat, strutils, sequtils
import json
#from functools import reduce
#flatten = lambda l: [item for sublist in l for item in (sublist if isinstance(sublist, list) else [sublist] )]
type
@xmonader
xmonader / errlog
Created July 31, 2018 08:27
errlog
 …/jumpscale_core    development  bash install.sh  127 ↵  root@ahmedheaven
INSTALL Jumpscale on branch development
[+] updating packages
[+] installing git, python, mc, tmux, curl
[+] upgrade pip
[+] Checking if https://github.com/threefoldtech/jumpscale_core/tree/development exists
[+] get code https://github.com/threefoldtech/jumpscale_core.git (development)
[+] pull
[+] Checking if https://github.com/threefoldtech/jumpscale_lib/tree/development exists
[+] get code https://github.com/threefoldtech/jumpscale_lib.git (development)
@xmonader
xmonader / copy-chroot.sh
Created August 6, 2018 06:57 — forked from muhamadazmy/copy-chroot.sh
Copy binaries to a chroot
#!/bin/bash
if [ $# != 2 ] ; then
echo "usage $0 PATH_TO_BINARY TARGET_FOLDER"
exit 1
fi
PATH_TO_BINARY="$1"
TARGET_FOLDER="$2"
from .IConfigManager import IConfigManager
from jumpscale import j
import sys
import re
import os
import copy
from .JSBaseClassConfig import JSBaseClassConfig
from .JSBaseClassConfigs import JSBaseClassConfigs
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeq1MFCQOv3OCLO1HxdQl8V0CxAwt5AzdsNOL91wmHiG9ocgnq2yipv7qz+uCS0AdyOSzB9umyLcOZl2apnuyzSOd+2k6Cj9ipkgVx4nx4q5W1xt4MWIwKPfbfBA9gDMVpaGYpT6ZEv2ykFPnjG0obXzIjAaOsRthawuEF8bPZku1yi83SDtpU7I0pLOl3oifuwPpXTAVkK6GabSfbCJQWBDSYXXM20eRcAhIMmt79zo78FNItHmWpfPxPTWlYW02f7vVxTN/LUeRFoaNXXY+cuPxmcmXp912kW0vhK9IvWXqGAEuSycUOwync/yj+8f7dRU7upFGqd6bXUh67iMl7 ahmed@ahmedheaven
from pynput import keyboard
logs = []
log = ""
def handle_key(key):
global log, logs
try:
log += key.char
print("LOG: ", log)
@xmonader
xmonader / gevent_exception_value.py
Last active June 26, 2019 07:48
gevent link exception and value
import gevent as g
from functools import partial
import traceback
def fn(*args, **kwargs):
print("ARGS: ", args)
print("KWARGS: ", kwargs)
g.sleep(3)
return 150
from gevent import monkey; monkey.patch_all()
import time, os, sys, inspect
from pickle import loads as pickle_loads, dumps as pickle_dumps
from dill import loads as dill_loads, dumps as dill_dumps
from redis import Redis
import gevent as g
from gevent import sleep
from hashlib import md5
from base64 import b64encode, b64decode
@xmonader
xmonader / myproj.nim
Last active October 23, 2019 19:25
myproj.nim
# This is just an example to get you started. A typical binary package
# uses this file as the main entry point of the application.
import strformat, tables, json, strutils, asyncdispatch, asyncnet, strutils, parseutils, options, net
from cgi import decodeUrl
import terminaltables
import mimetypes
type
# This is just an example to get you started. A typical binary package
# uses this file as the main entry point of the application.
import strformat, tables, json, strutils, sequtils, hashes, net, asyncdispatch, asyncnet, os, strutils, parseutils, deques, options, net
type ForwardOptions = object
listenAddr*: string
listenPort*: Port
toAddr*: string
toPort*: Port