Skip to content

Instantly share code, notes, and snippets.

View neilmillard's full-sized avatar

Neil Millard neilmillard

View GitHub Profile
@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active April 27, 2024 20:57
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"
@iampeterbanjo
iampeterbanjo / create-ssh-user.sh
Last active November 6, 2021 09:13
Create ssh user
# create new user, user directory and use bash shell
sudo useradd -m $1 -s /bin/bash
# add user to sudo group
usermod -a -G sudo $1
# use root ssh key for this user
mkdir -p /home/$1/.ssh
touch /home/$1/.ssh/authorized_keys
cat ~/.ssh/authorized_keys >> /home/$1/.ssh/authorized_keys
@shanedroid
shanedroid / halp.MD
Last active February 16, 2023 10:43
Add GitHub SSL Certificate to Jenkins Keystore

I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and would see the following errs in Jenkins log:

jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  1. Fetch the certificate from local GitHub:
openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt
@clstokes
clstokes / assume-role-policy.json
Last active September 1, 2022 20:15
Example: Terraform IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
@diegopacheco
diegopacheco / aws-dns-route53-dig.md
Last active January 6, 2016 17:05
AWS Route53 Fun with DNS: dig & cli53

How to Install on CentOs?

sudo yum install -y bind-utils
pip install cli53

Figureout the box name?

@reinaldomendes
reinaldomendes / curl.ini
Last active March 28, 2022 06:41
PHP Curl error 77 on ssl conections
;###################################################
; NOTE
;####################################################
; change your curl.ini on /etc/php.d/curl.ini
;
;This config was only tested on amazon AMI
;Please check if /etc/ssl/certs/ca-bundle.crt exists
;
;If you don't have the ca-bundle root certificate you
; can get this in
@matthewpizza
matthewpizza / install-composer.sh
Created February 13, 2014 03:55
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@ddoc
ddoc / rdns.sh
Created January 16, 2014 00:20
rdns creation script for foreman hooks https://github.com/theforeman/foreman_hooks. More information at: http://www.brian2.net/posts/foreman_hooks_aws_vpc/
#!/bin/bash
. /usr/share/foreman/config/hooks.d/lib/utils.sh
. $FOREMAN_HOME/config/hooks.d/lib/hook_functions.sh
set -x
IP=$(hook_data host.ip)
DNSNAME=$(hook_data host.name)
REVERSE=$(reverseIp ${IP})
rdns_create() {
echolog IP ${IP} calling nsupdate: dns3.server.name update add ${REVERSE}.in-addr.arpa. 86400 PTR $DNSNAME
@ddoc
ddoc / utils.sh
Created January 15, 2014 23:19
utility functions for foreman_hooks https://github.com/theforeman/foreman_hooks
#!/bin/bash
export FOREMAN_SERVER=$foremanserver/api
export FOREMAN_USER=apiuser
export FOREMAN_PASSWORD=$password
export FOREMAN_HOME=/usr/share/foreman
export PATH=$PATH:/usr/local/bin
reverseIp() {
local a i n
IFS=. read -r -a a <<< "$1"
// Datos view Template
$data=array(
//...
);
//Load lib
require_once'libs/Twig/Autoloader.php';
Twig_Autoloader::register();
//config path template