Skip to content

Instantly share code, notes, and snippets.

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
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'
+------------------------------------+-----------------+-------------+----------+---------------------+
| 137.74.198.100:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:30 |
| 176.9.3.149:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:30 |
| 5.9.118.112:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:30 |
| 5.9.137.199:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:31 |
| 5.9.149.169:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:31 |
| 88.198.230.98:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:36 |
| astra2261.startdedicated.net:14265 | tcp | 1.4.1.4 | IRI | 2017-12-22 18:13:37 |
| fakefake.net:14265 | tcp | 1.4.1.4 | IRI Test | 2017-12-22 18:13:37 |
| cryptoiota.win:14265 | tcp | 1.4.1.4 | IRI | 2017-1
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@soarez
soarez / ca.md
Last active July 24, 2024 12:02
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@gufranco-zz
gufranco-zz / railsInstaller.sh
Last active September 22, 2020 19:48
How to install Ruby, Git, Rails, PostgreSQL and MySQL on Ubuntu
#!/bin/sh
# System update
sudo apt-get update
# Curl
sudo apt-get -y install curl
# Git
sudo apt-get -y install git-core
@jaygooby
jaygooby / percona-xtrabackup.sh
Last active May 9, 2022 15:43
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@mbinna
mbinna / podforceupdate.sh
Created December 4, 2012 09:43
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update