Skip to content

Instantly share code, notes, and snippets.

View swipswaps's full-sized avatar

#swipswaps swipswaps

View GitHub Profile
@swipswaps
swipswaps / best_bash_history_hashBang_usr_bin_env_bash.sh
Last active September 28, 2018 13:17 — forked from ckabalan/best_bash_history.sh
The Best Bash History Settings Ever
#!/usr/bin/env bash
# /etc/profile.d/best_bash_history.sh
# Save 5,000 lines of history in memory
HISTSIZE=10000
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
HISTFILESIZE=2000000
# Append to history instead of overwrite
shopt -s histappend
# Ignore redundant or space commands
HISTCONTROL=ignoreboth
@swipswaps
swipswaps / newline_fixer.py
Created October 12, 2018 15:23 — forked from gautric/newline_fixer.py
files list file for package 'xxx' is missing final newline
#!/usr/bin/python
# 8th November, 2009
# update manager failed, giving me the error:
# 'files list file for package 'xxx' is missing final newline' for every package.
# some Googling revealed that this problem was due to corrupt files(s) in /var/lib/dpkg/info/
# looping though those files revealed that some did not have a final new line
# this script will resolve that problem by appending a newline to all files that are missing it
# NOTE: you will need to run this script as root, e.g. sudo python newline_fixer.py
@swipswaps
swipswaps / .remote-backup-excludes.txt
Created May 8, 2019 19:33 — forked from wrouesnel/.remote-backup-excludes.txt
A script for performing a remote backup to another server using rsync and bup for versioning.
# this is an rsync-excludes format list of files to exclude.
@swipswaps
swipswaps / lynis.sh
Created May 8, 2019 19:56 — forked from foozmeat/lynis.sh
Script to run lynis and notify you if something needs attention
#!/bin/sh
#set -x
EMAIL=someone@example.com
OLDHOME=${HOME}
cd ~/lynis
. /etc/apache2/envvars
./lynis -c -Q -q --profile /etc/lynis/default.prf
@swipswaps
swipswaps / lynis_autorunner.sh
Created June 7, 2019 21:48 — forked from philcryer/lynis_autorunner.sh
Download and run a Lynis audit scan on your system with this shell script.
#!/bin/sh
# This script will automatically:
# * download [Lynis](https://cisofy.com/lynis/), an open source security auditing tool
# * run a full audit check, either privileged, or non-privileged if not logged in as root
# * cleanup by removing the downloaded archive, and the extracted directory it ran out of
# * save the audit report to your local directory (YYYYMMDD-lynis-report)
#
# This script requires:
# * awk
@swipswaps
swipswaps / openvpn_installer
Created June 21, 2019 21:19 — forked from jc00ke/openvpn_installer
Installs OpenVPN
#!/bin/bash
# OpenVPN Installer
#
# This installer was designed to work with Ubuntu 14.04. It installs
# an OpenVPN server, generates an associated OpenVPN client configuration file,
# configures a firewall, and enables automatic security updates.
#
# Once the installer finishes, the `/root/client.ovpn` file will have been generated.
# Download this file to your local machine and open it in an OpenVPN client and you'll
@swipswaps
swipswaps / google-translate-tooltip.user.js
Created July 18, 2019 18:39 — forked from steelywing/google-translate-tooltip.user.js
google translate tooltip for firefox & chrome
// ==UserScript==
// @name Google Translate Tooltip
// @namespace steely.wing
// @version 1.10
// @description Translates selected text into a tooltip.
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/)
// @include *
// @require http://code.jquery.com/jquery-2.1.0.min.js
// @grant GM_getValue
# Copied from http://ttaportal.org/wp-content/uploads/2012/10/7-Reallocation-using-LVM.pdf
##
## Showing the problem: need to reallocate 32GB from /dev/mapper/pve-data to /dev/mapper/pve-root
##
df -h
# Filesystem Size Used Avail Use% Mounted on
# /dev/mapper/pve-root 37G 37G 0 100% /
# tmpfs 2.0G 0 2.0G 0% /lib/init/rw
@swipswaps
swipswaps / draw.js
Created December 10, 2019 22:23 — forked from mohdsanadzakirizvi/draw.js
PoseNet demo with Ml5.js
function draw() {
image(video, 0, 0, width, height);
// We can call both functions to draw all keypoints and the skeletons
drawKeypoints();
drawSkeleton();
}
#/bin/bash
## taking.kr (webmaster@taking.kr)
## 2019-06-11
###########################################
read -p "hostname (ex taking.kr): " uhost
read -p "new username: " uname
read -p "$uname's Password: " upasswd
encrypt_pass=$(perl -e 'print crypt($ARGV[0], "password")' $upasswd)
############ nameserver setting ###############