Skip to content

Instantly share code, notes, and snippets.

View adamdilek's full-sized avatar
🎯
focusing

Adam Dilek adamdilek

🎯
focusing
View GitHub Profile
@adamdilek
adamdilek / chromeinstall_ubu16.sh
Created August 16, 2019 15:06 — forked from LoganGray/chromeinstall_ubu16.sh
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, Jan 2019
cd ~
sudo apt-get update
sudo apt install python-pip
pip install simplejson
pip install bs4
pip install selenium
apt-get install libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip
sudo apt-get install -y libappindicator1 fonts-liberation
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@adamdilek
adamdilek / readme.md
Created May 5, 2018 19:46 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App
@adamdilek
adamdilek / siege_examples.sh
Created January 19, 2017 03:50 — forked from rob-murray/siege_examples.sh
Siege examples
# Basic example
siege -t60s -c20 -d10 'http://robertomurray.co.uk/'
# Basic auth;
$auth = echo -n 'username:password' | openssl base64
siege -t60s -c20 -d10 --header="Authorization:Basic $auth" 'https://staging.a-hostname.co.uk/'
@adamdilek
adamdilek / nginx.config
Created October 3, 2016 21:33 — forked from jakemmarsh/nginx.config
Modify nginx proxy settings in Elastic Beanstalk options
files:
"/tmp/proxy.conf":
mode: "000644"
owner: root
group: root
content: |
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
@adamdilek
adamdilek / nginx-multiple-if.conf
Created October 3, 2016 21:23 — forked from Coopeh/nginx-multiple-if.conf
How to use multiple if statements in Nginx
set $posting 0; # Make sure to declare it first to stop any warnings
if ($request_method = POST) { # Check if request method is POST
set $posting N; # Initially set the $posting variable as N
}
if ($geoip_country_code ~ (BR|CN|KR|RU|UA) ) { # Here we're using the Nginx GeoIP module to block some spammy countries
set $posting "${posting}O"; # Set the $posting variable to itself plus the letter O
}
@adamdilek
adamdilek / install-ffmpeg-amazon-linux.sh
Last active October 1, 2016 14:57
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@adamdilek
adamdilek / rails-4-new-options
Created July 10, 2016 11:13 — forked from brianpetro/rails-4-new-options
Command line options for ` rails new --help ` (Rails 4.2). Useful for planning new Ruby on Rails app. 'Where can I find options for “rails new” command?'
Because I couldn't find these with a quick Google search on 28 April 2015:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
@adamdilek
adamdilek / node.js
Created July 5, 2016 23:00 — forked from Roman2K/node.js
Ruby/node encryption/decryption
const crypto = require('crypto');
const PASSWORD = "098f6bcd4621d373cade4e832627b4f6"
, MESSAGE = 'test';
function InvalidSignatureError() {
Error.captureStackTrace(this, this.constructor);
}
function encipher(message, password, callback) {
@adamdilek
adamdilek / iterm2.md
Created July 3, 2016 10:03
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [