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/sh | |
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/ | |
set -x | |
# stop service | |
systemctl stop pvestatd.service | |
systemctl stop pvedaemon.service | |
systemctl stop pve-cluster.service | |
systemctl stop corosync |
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
/* | |
* LSM303AGR Compass Example | |
* | |
* From what I can gather, this shows the proper way to get a compas heading from the LSM303. | |
* It solves two problems which aren't addressed in the Adafruit example code: | |
* 1.) Show how to incorporate min and max values from calibration. Makes a HUGE difference in my testing. | |
* 2.) Take the z-axis into account. | |
* | |
* Based heavily off Adafruit example code and https://github.com/pololu/lsm303-arduino. | |
*/ |
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/sh | |
# ensure local python is preferred over distribution python | |
export PATH=/usr/local/bin:$PATH | |
# http://bugs.python.org/issue19846 | |
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. | |
export LANG=C.UTF-8 | |
# install ca-certificates so that HTTPS works consistently |
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 python | |
import json | |
import operator | |
def get_top(hash_to_count, hash_to_name, top=1000): | |
sorted_counts = sorted(hash_to_count.items(), key=operator.itemgetter(1), reverse=True) | |
results = [] | |
for h, c in sorted_counts[0:top]: | |
results.append((h, c, hash_to_name[h])) | |
return results |
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
import gnu.trove.map.TObjectLongMap; | |
import gnu.trove.map.hash.TObjectLongHashMap; | |
import org.jf.dexlib2.Opcode; | |
import org.jf.dexlib2.iface.ClassDef; | |
import org.jf.dexlib2.iface.DexFile; | |
import org.jf.dexlib2.iface.Field; | |
import org.jf.dexlib2.iface.Method; | |
import org.jf.dexlib2.iface.MethodImplementation; | |
import org.jf.dexlib2.iface.instruction.Instruction; |
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 python | |
import ujson as json | |
import matplotlib | |
matplotlib.use("Agg") | |
import matplotlib.pyplot as plt | |
import matplotlib.ticker as plticker | |
def graph_class_counts(): |
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
import gnu.trove.map.TCharDoubleMap; | |
import gnu.trove.map.hash.TCharDoubleHashMap; | |
import java.io.Serializable; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.regex.Pattern; | |
public class MarkovChain implements Serializable { | |
private static final long serialVersionUID = 986958034001823764L; |
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 python | |
"""ferret_files.py: Recursively find and copy files with some file type.""" | |
import hashlib | |
import os | |
import shutil | |
import argh | |
import magic |
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 python | |
import collections | |
import matplotlib.patches as mpatches | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import sklearn as skl | |
import itertools |
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
import java.util.Arrays; | |
import java.util.function.IntUnaryOperator; | |
import java.util.stream.IntStream; | |
public class StreamExamples { | |
public static void main(String[] args) { | |
int[] myData = new int[]{1, 1, 2, 3, 5, 8, 13, 21, 34}; | |
System.out.println("myData: " + Arrays.toString(myData)); |
NewerOlder