Skip to content

Instantly share code, notes, and snippets.

View fukawi2's full-sized avatar

Phillip Smith fukawi2

View GitHub Profile
@fukawi2
fukawi2 / monitor-mdadm.sh
Created October 7, 2015 00:48
Monitor mdadm array on desktop PC
#!/bin/bash
set -e
set -u
declare -r ARRAY_DEV="${1-}"
if [[ -z "$ARRAY_DEV" ]] ; then
zenity --info --text "Usage: $0 [array_device]"
exit -1
fi
@fukawi2
fukawi2 / ipcnt
Last active October 7, 2015 01:05
ipcnt
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Phillip Smith
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@fukawi2
fukawi2 / gist:329aa44e9a6486f0f739
Created March 2, 2015 01:12
low-mem vps swapfile
swapfile=/swapfile.0
fallocate -l 1G $swapfile
chmod 600 $swapfile
mkswap $swapfile
swapon $swapfile
echo "$swapfile none swap sw 0 0" >> /etc/fstab
sysctl vm.swappiness=10
echo vm.swappiness=10 > /etc/sysctl.d/swappiness
@fukawi2
fukawi2 / ghost-test.yml
Created January 28, 2015 00:54
Ansible playbook to test for CVE-2015-0235 ("Ghost")
- hosts: all
sudo: yes
tasks:
- name: copy code
copy: src=ghost.c dest=/tmp/ghost.c mode=400
# obtain above code from https://gist.github.com/koelling/ef9b2b9d0be6d6dbab63
- name: compile code
command: chdir=/tmp
gcc -o ghost-test ghost.c
@fukawi2
fukawi2 / keybase.md
Created September 18, 2014 23:53
keybase.md

Keybase proof

I hereby claim:

  • I am fukawi2 on github.
  • I am fukawi2 (https://keybase.io/fukawi2) on keybase.
  • I have a public key whose fingerprint is 6050 71EC A86C 954B 8665 85C0 567A 6F39 6F2C FC03

To claim this, I am signing this object:

@fukawi2
fukawi2 / exifpic.pl
Created February 18, 2013 03:36 — forked from pjf/exifpic.pl
# /usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use threads;
use Thread::Queue;
use autodie qw(:all);
use Image::ExifTool qw(ImageInfo);
use Data::Dumper;
use Imager;