Skip to content

Instantly share code, notes, and snippets.

View adambair's full-sized avatar

Adam Bair adambair

View GitHub Profile
@Chocksy
Chocksy / kill_sidekiq_job.rb
Last active April 25, 2024 14:07
Kill sidekiq jobs by process id for busy jobs and by jid for other sets.
# FOR BUSY JOBS
# take the process_id from the /busy page in sidekiq and kill the longest running one.
workers = Sidekiq::Workers.new
long_process_id = 'integration.3:4:71111aaa111' # Eg: 'integration.3:4:71d1d7f4ef5a'
workers.each do |process_id, thread_id, work|
process = Sidekiq::Process.new('identity' => process_id)
process.stop! if process_id == long_process_id
end
# FOR SCHEDULED JOBS
@PavloBezpalov
PavloBezpalov / 1. ELK.install
Last active January 5, 2024 16:14
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
@varyonic
varyonic / docker-compose.yml
Last active May 18, 2021 13:18
Capybara standalone Selenium Chrome config
web:
build: .
volumes:
- .:/opt/myapp
ports:
- '3000:3000'
links:
- db
- redis
- selenium
@junegunn
junegunn / gist:f4fca918e937e6bf5bad
Last active May 24, 2024 02:07
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
@brentmc79
brentmc79 / getting-started-with-quadcopters.md
Last active August 29, 2015 14:14
Getting Started with Quadcopters

Getting Started With Quadcopters

Learn to Fly

Buy a Hubsan X4. Fly it. Crash it. Repeat. Do this until you feel comfortable in the air.

Nomenclature

  • 250/450/etch - This refers to the size of the quad, specifically the motor-to-motor distance in millimeters. 250 is the standard FPV race quad size.
  • FPV - First Person View
@tbeseda
tbeseda / commit-msg
Created March 24, 2014 18:26
Append current Rdio track to commit message
#!/usr/bin/ruby
message_file = ARGV[0]
def app_is_running?(app_name)
`ps aux` =~ /#{app_name}/ ? true : false
end
while true
if app_is_running?('Rdio.app')
@TheNicholasNick
TheNicholasNick / 01 Install Arch Linux Guest on VirtualBox.md
Last active November 26, 2017 14:24
Simple to the point no fluff install Arch Linux Guest on VirtualBox
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active May 26, 2024 17:26
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@adam-stokes
adam-stokes / bobobogo.lua
Created June 11, 2013 17:14
Using imapfilter to pipe messages through bogofilter
all = myserver.INBOX:select_all()
spam = Set {}
unsure = Set {}
for _, mesg in ipairs(all) do
mbox, uid = unpack(mesg)
text = mbox[uid]:fetch_message()
flag = pipe_to('bogofilter', text)
if (flag == 0) then
table.insert(spam, mesg)
elseif (flag == 2) then