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/python3 | |
from ws4py.client.threadedclient import WebSocketClient | |
from pprint import pprint | |
import json | |
params = {} | |
params['Type'] = "Admin" | |
params['Request'] = 'Login' | |
params['RequestId'] = 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
#!/bin/bash | |
# On local machine | |
lxc launch images:ubuntu/wily/amd64 ubuntu-64 | |
lxc publish ubuntu-64 db-server | |
scp /var/lib/lxc/images/<fingerprint id from lxc publish> | |
# On remote host | |
lxc image import 63c7c79560194cf9792fc34d0a8c63ff6fe17b0a4dc185ac9544b079f4b2a7fc | |
lxc launch 63c7c7956019 u1 |
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
//You can use any package name here. | |
//It's not required to match the namespace of php file. | |
package; | |
import php.NativeStructArray; | |
typedef EncodingOptions = { | |
?prettyPrint:Bool, | |
?enableJsonExprFinder:Bool, | |
} |
helper/cli.clj
(ns helper.cli
(:require [clojure.edn :as edn]
[clojure.string :as str]
[babashka.fs :as fs]
[babashka.tasks :refer [shell current-task run]]
[lread.status-line :as status]))
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 | |
""" | |
Password maker | |
https://xkcd.com/936/ | |
This is a script which can generate random passwords for you by selecting from a file which contains seed words | |
""" | |
import argparse | |
import random | |
import re |
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 sh | |
############################################# | |
# WARNING # | |
# No more commits are going to be made to # | |
# this gist. Please get the latest script # | |
# from the new repository: # | |
# https://github.com/pixelomer/macos-mkjail # | |
############################################# |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"testing" | |
) | |
func Test1(t *testing.T) { | |
if 1+2 != 3 { |
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
# Retry a command up to a specific numer of times until it exits successfully, | |
# with exponential back off. | |
# | |
# $ retry 5 echo Hello | |
# Hello | |
# | |
# $ retry 5 false | |
# Retry 1/5 exited 1, retrying in 1 seconds... | |
# Retry 2/5 exited 1, retrying in 2 seconds... | |
# Retry 3/5 exited 1, retrying in 4 seconds... |
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
cat <<EOF> profile-update.yaml | |
config: {} | |
description: Default LXD profile - updated | |
devices: | |
eth0: | |
name: eth0 | |
parent: lxdbr0 | |
nictype: bridged | |
type: nic | |
root: |
NewerOlder