Skip to content

Instantly share code, notes, and snippets.

View terabyte's full-sized avatar

Carl Myers terabyte

View GitHub Profile
// Copyright (c) 2019 Cloudera, Inc. All rights reserved.
/**
* Uploads a new GBN
*/
import com.cloudera.dsl.Common
freeStyleJob('PublishGenericGBN') {
1. Backup original image, if applicable
* Boot off thumb drive
* use external thumb drive for target of backup
* install pigz
* dd if=/dev/whatevs | pigz | split --size=1G - whatevs.img.gz
2. Install debian with full disk encryption
3. Apt-get install normal applications
* see: howtos/new-machine-apt-get.txt
4. Run burn-in tests
5. Rsync over homedir
apt-get update
apt-get upgrade -y
apt-get install -y vim htop less zsh tmux sudo git mosh gawk strace build-essential openjdk-8-jdk sysbench gdisk cryptsetup lvm2 tree screen dosfstools network-manager openconnect network-manager-openconnect lm-sensors xxd xz-utils pigz gcc g++ make cmake automake neovim perl screen libncurses5-dev ncurses-bin iotop iftop mpg123 locales-all tzdata locate libevent-dev pkg-config imagemagick exuberant-ctags libssl-dev rsync expect shellcheck curl nmap virtualenv python3 flake8 pv apt-transport-https dnsutils avahi-utils gist net-tools jq
# laptop only stuff
sudo apt-get install powertop laptop-detect rfkill pm-utils acpid xbacklight
# secondary coding stuff
sudo apt-get install docker.io
#!/usr/bin/env bash
# this script is run whenever the status of the AC adapter changes
# user who is expected to be running the x server (i.e. has Xauthority)
XUSER="cmyers"
# how long a delay between plugging in power and battery status no longer shows discharging
SLEEP_DELAY="0.5s"
extern crate json;
extern crate rhai;
use rhai::{Engine, RegisterFn, Scope};
use std::env;
use std::io::prelude::*;
use std::io;
fn jv_put_string(rec: &mut json::JsonValue, key: String, value: String) {
jv_put_jv(rec, key, json::JsonValue::from(value));
[package]
name = "recs_test"
version = "0.1.0"
authors = ["Carl Myers <cmyers@cmyers.org>"]
[dependencies]
argparse = "0.2.2"
json = "0.11.13"
lazy_static = "1.2.0"
regex = "1.1.0"
@terabyte
terabyte / blah.java
Created May 24, 2018 23:36
{meme}Is this ok?
class A {
public void someMethod {
// ...
AtomicInteger count = new AtomicInteger();
someList.forEach((Object) o -> {
// ...
count.incrementAndGet();
// ...
}
}
ERROR:buildinfo.build:Failed to create: 'list' object has no attribute 'items'
Traceback (most recent call last):
File "/home/cmyers/ves/builddb/local/lib/python2.7/site-packages/buildinfo/build.py", line 419, in __init__
for component, m3 in m2.items():
AttributeError: 'list' object has no attribute 'items'
Traceback (most recent call last):
File "/home/cmyers/ves/builddb/bin/buildinfo", line 11, in <module>
load_entry_point('buildinfo==0.1', 'console_scripts', 'buildinfo')()
File "/home/cmyers/ves/builddb/local/lib/python2.7/site-packages/buildinfo/__init__.py", line 327, in main
root(obj={})
https://gist.github.com/9c05b8b018dce0a681b525ed09193d54
INFO:gerrit-trigger:Namespace(dry_run=False, gerrit_change_id='Id1e7d6ed6d14a5bc41eef07c155015fd77560a40', gerrit_change_owner_email=None, gerrit_disable=False, gerrit_host='gerrit.sjc.cloudera.com', gerrit_port=29418, gerrit_readonly=False, gerrit_refspec='refs/changes/40/31840/13', gerrit_ssh_user='cmyers')
INFO:gerrit-trigger:gerrit instance: <gerrit.GerritInstance object at 0x7f11af228110>
Traceback (most recent call last):
File "./gerrit-apicompat.py", line 141, in <module>
main()
File "./gerrit-apicompat.py", line 137, in main
sys.exit(jenkins_trigger(args))
File "./gerrit-apicompat.py", line 107, in jenkins_trigger
compat_cmd = [os.path.join(path, 'apicompat/checkcompatibility.py') + jacc_opts, baseline_branch, patch_branch]
TypeError: cannot concatenate 'str' and 'list' objects