Skip to content

Instantly share code, notes, and snippets.

@bmaupin
bmaupin / UnlimitedJCEPolicyJDK7-RHEL.sh
Last active April 24, 2017 20:39
Install UnlimitedJCEPolicyJDK7.zip on RHEL/CentOS
# See here for JDK 8: https://gist.github.com/bmaupin/87631863d55e2accc05ca7759247f887
# See here for test to make sure this works: https://gist.github.com/evaryont/6786915
if grep -q -i "release 6" /etc/*release; then
jce_primary_link_dir=/usr/lib/jvm/jre-1.7.0-oracle.x86_64/lib/security
elif grep -q -i "release 7" /etc/*release; then
jce_primary_link_dir=/usr/lib/jvm/jce-1.7.0-oracle
fi
wget \
@bmaupin
bmaupin / .gitignore
Last active October 7, 2017 13:29
Grails 2.x gitignore
# Eclipse files
.classpath
.project
# H2 database files
/*Db.*
# IntelliJ files
*.iws
/out/
@bmaupin
bmaupin / build-vice.sh
Last active October 11, 2017 07:44
Build Vice emulator on Ubuntu
# Get the latest version from http://vice-emu.sourceforge.net/index.html#download
vice_version=3.1
mkdir tmp-vice
cd tmp-vice
# Install dependencies
sudo apt install bison build-essential flex libasound2-dev libgnome2-dev libgtk2.0-dev libvte-dev
wget http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/vice-$vice_version.tar.gz
@bmaupin
bmaupin / install-swift.sh
Last active December 23, 2017 19:27
Install Swift on Ubuntu
# Recommended: use swiftenv instead of this: https://swiftenv.fuller.li/
# https://swift.org/download/#using-downloads
# Get latest Swift version from https://swift.org/download/
swift_version=4.0.3
sudo -v
# Clean up previous versions
@bmaupin
bmaupin / install-go.sh
Last active January 9, 2018 18:14
Install or upgrade Go on Ubuntu
# Get latest version from https://golang.org/dl/
go_version=1.9.2
sudo -v
# Clean up old versions
sudo apt-get remove golang-go
sudo rm -rf /usr/local/go
wget https://storage.googleapis.com/golang/go$go_version.linux-amd64.tar.gz
sudo tar -C /usr/local -xvf go$go_version.linux-amd64.tar.gz
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Array iteration</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@bmaupin
bmaupin / mycloud-vulnerabilities.md
Last active January 20, 2018 17:43
Investigating My Cloud vulnerabilities

Description of vulnerabilities: WDMyCloud Multiple Vulnerabilities

Update 2018-01-20

Both critical vulnerabilities (the hard-coded backdoor and the file upload vulnerability) have been corrected as of 2018-01-12 with the following firmwares:

My Cloud device Firmware
@bmaupin
bmaupin / centos-7-auto-updates.md
Created March 6, 2018 18:29
Enable automatic updates on CentOS 7
  1. Install yum-cron

    sudo yum install yum-cron
    
  2. Modify /etc/yum/yum-cron.conf

    At a minimum:

    download_updates = yes
    

apply_updates = yes

@bmaupin
bmaupin / uninstaller_HLL2360D.sh
Created April 22, 2018 17:54
Brother HL-L2360DW Ubuntu driver uninstall script
#! /bin/bash
#RM_SELINUX_RULE=enable
#
# PRNL=hll2360dlpr-3.2.0-1a.i386.deb
# PRNC=hll2360dcupswrapper-3.2.0-1a.i386.deb
# SCAN=
# SKEY=
#
if ! [ -f /etc/init.d/cupsys ];then
DUMMYCUPSYS=1
@bmaupin
bmaupin / xubuntu-free-memory.sh
Last active June 7, 2018 12:17
Free up memory on Xubuntu by restarting some memory-hungry programs
#!/bin/bash
free
dropbox stop && sleep 60 && dbus-launch dropbox start
xfce4-panel -r
free