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 / 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
@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'
@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)
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@anthonyclarka2
anthonyclarka2 / tmux-cheatsheet.markdown
Created October 31, 2018 20:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@anthonyclarka2
anthonyclarka2 / sysctl.conf
Last active October 17, 2017 17:19 — forked from dayreiner/sysctl.conf
A decent base to start tuning off of for centos 7 apache and mariadb systems
# Other links:
# https://christophermonzon.wordpress.com/2016/10/04/centos-7-network-performance/
# https://lwn.net/Articles/616241/
# https://wiki.mikejung.biz/Sysctl_tweaks
# https://access.redhat.com/solutions/190643
# http://fasterdata.es.net/network-tuning/udp-tuning/
# MariaDB Tuning
vm.swappiness = 1