Skip to content

Instantly share code, notes, and snippets.

View yubik9's full-sized avatar
🏠
Working from home

Yubik9 yubik9

🏠
Working from home
View GitHub Profile
@yubik9
yubik9 / Dockerfile
Created August 11, 2017 07:31 — forked from RoyalIcing/Dockerfile
Rails 5.1 Dockerfile
FROM ruby:2.4-alpine
ENV PATH /root/.yarn/bin:$PATH
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh build-base nodejs tzdata
RUN apk update \
&& apk add curl bash binutils tar gnupg \
&& rm -rf /var/cache/apk/* \
#!/bin/bash
# HOSTLIST="ips" bash < <(curl -fsSL https://gist.github.com/fanminjian/e3f5a07f51a9d423b800edb754bb4e06/raw)
# Hostname
node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'`
hostname="node$node"
echo $hostname > /etc/hostname
@yubik9
yubik9 / .profile
Created August 17, 2016 12:19 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFez+4UBEADaqzQKbv2k5Jb3j+8x9zFutf5BzsSIAOMoVkEUbkVlAXyR8l7b
+DbdxYEZutqYmhcDfegGpBDRuyyakL7+HL9nfWXlHqIMlENMocerev887AMpZBE+
7gdU0VDyqA4D7aqgYL9NwI7C635aF2eWMfYhz8ayAYI44d79XmVAFYcC7O7HQCY/
VXWFohRQYIUtDW/pBrx+Rbyp7oGOYwH4Wq1VaR3z/uFkixq3RRhZPp53p/ZvjWo/
wSpuWtJb671nMvkYzu4mEWaLy95QFunmaPXge1SQhq8s/eBBrc/g0mEOyD9qd1B5
VM09Y3ds7cS5bFUURZSWwWnW7gVLsazy28fSvqnHmeDLvjEcH1BWn89Iyr23giVI
r4chFL2N9AtaAI+nMLNXJLmmA7MwfnhZtY4OFtAWQHA8tcObYmBVGcnQMfPlpmzL
c7hM2F2XMUWFXS+DPv6CuVB6Uf8XGNTLpG+Hpzxalb5x86PTVBpiOHQIIu7hxc76
@yubik9
yubik9 / personal_config.rb
Created May 11, 2016 01:32
personal_config.rb
Rails.application.configure do
config.assets.debug = false
end
@yubik9
yubik9 / web-servers.md
Created January 18, 2016 05:38 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
  • Install the latest JRE from Oracle
  • In the Java Control Panel, go to the Security tab and make sure 'Enable Java Content' is checked
  • Open Safari
  • Go to the ATO Business portal site https://bp.ato.gov.au/BpStatics/homepage.htm
  • Click Login
  • A dialog will apear asking you 'Do you want to trust the website “authentication.business.gov.au” to use the “Java” plug-in?'
  • Click 'Trust'
  • Now you will be asked 'Do you want to run this application?'
  • Click 'Run'
  • Another dialog will appear asking you to 'Allow access to the following application from this website?'
@yubik9
yubik9 / gist:19c38992f6bcf43ba288
Created April 1, 2015 11:19
fix_recurring_invoices.rb
times = [].tap { |a| 24.times { |i| a << (DateTime.parse("2015-04-01 03:00").to_f - i*3600) }}
times.each {|t| Scheduled::Practices::MonthlyInvoices.new.perform(nil, t) }
# lib/tasks/deploy.rake
namespace :deploy do
desc 'Deploy to staging environment'
task :staging do
exec 'mina deploy -f config/deploy/staging.rb'
end
end
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.