Skip to content

Instantly share code, notes, and snippets.

View bengarrett's full-sized avatar
:shipit:

Code by Ben bengarrett

:shipit:
View GitHub Profile
@bengarrett
bengarrett / git_tips.md
Last active August 22, 2020 03:58
Git tips
git branch -vv # branch detailed info

git status -sb # brief status

git reflog # reference log

git fsck --lost-found # orphaned files

git log -- somefile.txt # logs for file, even if long deleted
@bengarrett
bengarrett / server.xml
Created May 13, 2015 06:56
List of hardened Java 7/8 ciphers for use with Tomcat HTTPS
ciphers="TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
@bengarrett
bengarrett / thumbs.md
Last active June 20, 2022 14:23
Generate and optimise thumbnails using GraphicsMagick and pngquant

Generate and optimise thumbnails using GraphicsMagick and pngquant

Install

Install gm and pngquant.

apt-get install gm pngquant

Generate

Generate a thumbnail. You can replace -thumbnail with -resize for a clearer thumbnail that will result in a larger file size.

@bengarrett
bengarrett / tar.md
Created April 18, 2015 03:16
Helpers and common usage for tar

Tar

Compress (backup) files and directories

Common arguments

-c create an archive

-f file.tar filename of archive

-v verbose

@bengarrett
bengarrett / rsync.md
Last active November 6, 2020 20:03
Rsync - Helpers and common usage.

Rsync

Common arguments

-v verbose

-h humanise the output by implementing binary multipliers instead of byte values etc.

-P display progress and allow resumption of interrupted transfers

-n do a dry run for testing

@bengarrett
bengarrett / percona-xtrabackup.md
Last active April 30, 2020 06:38
Installing and using Percona XtraBackup on Ubuntu 14.04 for MySQL backups.

Installing and using Percona XtraBackup

For MySQL/MariaDB database servers on Ubuntu.

Set-up and Install

Add Percona to your repository.

Backup your sources.

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Edit your sources.
@bengarrett
bengarrett / hyper-v.cmd
Last active March 23, 2023 13:59
Changes the status of Windows Hyper-V to enable you to use other Virtualization software such as VirtualBox and VMware.
::File: c:\terminal\cmd-scripts\hyper-v.cmd
@echo off
echo.
if [%1] == [] goto help1
if "%1" == "/?" goto help1
goto check_Permissions
:check_Arguments
@bengarrett
bengarrett / _readme.md
Last active August 24, 2016 05:26
A collection of Windows command scripts

A collection of Windows command scripts

These should be placed in c:\terminal\cmd-scripts\

  • ~.cmd - A short-cut to jump into the user's home directory
  • edit.cmd - Edit a document using notepad++ from the command prompt
  • ll.cmd - Emulate the Bash ll alias in command prompt, requires Windows port of ls
  • npml.cmd - List global installed Node.js packages from the command prompt
  • pubid.cmd - Displays your public RSA 2 key in terminal, it assumes you have one created by Putty or ssh