Skip to content

Instantly share code, notes, and snippets.

View anthonyclarka2's full-sized avatar

Anthony Clark anthonyclarka2

  • Nexient
  • Ann Arbor, MI
View GitHub Profile
@anthonyclarka2
anthonyclarka2 / afowler-nohost-root.zsh-theme
Created September 9, 2019 16:23
a simple modification of the oh-my-zsh theme "afowler" without the hostname included, and adding ROOT in red letters when $uid=0
if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{${fg_bold[$CARETCOLOR]}%}ROOT%{${reset_color}%} %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
@anthonyclarka2
anthonyclarka2 / swap_check.sh
Created September 5, 2019 17:51 — forked from goiko74/swap_check.sh
display swap usage per PID (no sudo)
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Modified by Mikko Rantalainen 2012-08-09
# Pipe the output to "sort -nk3" to get sorted output
# Modified by Marc Methot 2014-09-18
# removed the need for sudo
SUM=0
OVERALL=0
ilikepi 1 hour ago | unvote [-]
It's not to hard to extract the app bundle from the .pkg file. This is how I've always installed it. Do this from an empty directory, though, since it will just spray files everywhere...
* Use `xar` to extract the contents of the .pkg file:
$ xar -xf Zoom.pkg
* Use `cpio` to extract the payload, which is in a file oddly named "Scripts":
# Basic .zshrc for use on WSL (Windows Subsystem for Linux)
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet
export ZSH="/home/aclark/.oh-my-zsh"
# Outputs: "fedora :: ~ »"
ZSH_THEME="afowler"
# Check once a month for oh-my-zsh updates
export UPDATE_ZSH_DAYS=28
@anthonyclarka2
anthonyclarka2 / attributes.rb
Created April 20, 2019 15:33 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'

Keybase proof

I hereby claim:

  • I am anthonyclarka2 on github.
  • I am anthonyclarka2 (https://keybase.io/anthonyclarka2) on keybase.
  • I have a public key ASAk4XwYIOY8dzUKXPCH6JyN1lsw8R1TpivP3UmwH_tqowo

To claim this, I am signing this object:

@anthonyclarka2
anthonyclarka2 / .emacs
Created April 10, 2019 19:59
Emacs startup file for org-mode and org-mode Jira
;; global variables
(setq
inhibit-startup-screen t
create-lockfiles nil
make-backup-files nil
column-number-mode t
scroll-error-top-bottom t
show-paren-delay 0.5
use-package-always-ensure t
sentence-end-double-space nil)
@anthonyclarka2
anthonyclarka2 / run-batch-job.sh
Created March 7, 2019 18:35 — forked from gpittarelli/run-batch-job.sh
GNU Parallel autoscaling workload example
#!/usr/bin/env bash
(
while ((1)); do
gcloud --format=json compute instances list --filter="name~'nlp-workers-.*'" | \
jq -rc '.[]|select(.status=="RUNNING").name' > workers.hosts.txt
sleep 30s
done
) & # (or, just run this watcher in a separate script)
17:08:26,899 WARNING systemd:Cannot add dependency job for unit rhel-autorelabel.service, ignoring: Unit is masked.
17:08:26,943 WARNING systemd:Cannot add dependency job for unit systemd-tmpfiles-clean.timer, ignoring: Unit is masked.
17:08:26,959 INFO rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-34.el7" x-pid="3657" x-info="http://www.rsyslog.com"] exiting on signal 15.
17:08:26,979 INFO systemd:Stopping System Logging Service...
17:08:27,010 INFO systemd:Stopped System Logging Service.
17:08:27,101 INFO systemd:Starting System Logging Service...
17:08:27,492 INFO rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-34.el7" x-pid="3735" x-info="http://www.rsyslog.com"] start
17:08:27,496 NOTICE kernel:type=1400 audit(1549213707.489:13): avc: denied { read } for pid=3735 comm="in:imjournal" name="imjournal.state" dev="dm-0" ino=679 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=file permissive=1
17:08:27,537 INFO systemd:Started System Logging Service.
17
Running... mount -o loop /tmp/boot.iso /var/tmp/lorax.imgutils.ey1yb62_
mount: /var/tmp/lorax.imgutils.ey1yb62_: WARNING: device write-protected, mounted read-only.
Return code: 0
Running... isoinfo -d -i /tmp/boot.iso
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: CentOS 7 x86_64
Volume set id:
Publisher id:
Data preparer id: