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
import gevent | |
from gevent.monkey import patch_all | |
patch_all() | |
import requests | |
import json | |
s = requests.Session() | |
def make_request(s, d): |
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
# salt-call state.show_lowstate | |
[INFO ] The `lspci` binary is not available on the system. GPU grains will not be available. | |
[WARNING ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate. | |
[INFO ] The `lspci` binary is not available on the system. GPU grains will not be available. | |
[WARNING ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate. | |
[INFO ] Loading fresh modules for state activity | |
local: | |
---------- | |
- __env__: | |
base |
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
#/srv/salt-state/basepkgs.sls | |
basepackages: | |
pkg.latest: | |
- pkgs: | |
- apt-transport-https | |
- bc | |
- debconf-utils | |
- emacs-goodies-el | |
- emacs23-nox | |
- htop |
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
{-# LANGUAGE GADTs #-} | |
import Text.XML.Light | |
mkElt :: String -> (Attributes, Body) -> Element | |
mkElt name (attribs, body) = Element { | |
elName = unqual name, | |
elAttribs = map (\(k, v) -> Attr (unqual k) v) attribs, | |
elContent = [Text (CData CDataRaw body Nothing)], | |
elLine = Nothing |
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
import Data.Int (Int64) | |
divisors :: Int64 -> [Int64] | |
divisors k = divisors' 2 k | |
where | |
divisors' n k | n*n > k = [k] | |
| n*n == k = [n, k] | |
| k `mod` n == 0 = (n:(k `div` n):result) | |
| otherwise = result | |
where result = divisors' (n+1) k |
NewerOlder