Skip to content

Instantly share code, notes, and snippets.

View hoomand's full-sized avatar

Bijan Hoomand hoomand

View GitHub Profile
@amcolash
amcolash / flowkey.js
Last active August 7, 2023 14:50
UPDATE, see here: https://github.com/amcolash/flowkey-scraper - Noteflight auto transcribe
// Find the sheet music images on the page
const elements = document.getElementsByClassName('split-image');
// Check that there are actually images on the page
if (elements.length === 0) {
console.error('No images found');
} else {
// If images were found, extract the base url from the 1st one
const imageUrl = elements[0].src;
const imageIdMatch = /\/sheets\/([\w\d]+)\//;
@davehughes
davehughes / .pgpass
Last active December 6, 2022 10:38
psql connection aliasing/management
# alias:northwind
db1.example.com:5432:northwind:postgres:hunter2
# alias:mainframe
db1.example.com:5432:mainframe:dave:password123
db1.example.com:5432:unaliased:postgres:
@aeberlin
aeberlin / .rubocop.yml
Last active October 12, 2018 14:35
Sane RuboCop Configuration
AllCops:
RunRailsCops: true
DisplayCopNames: true
DisplayStyleGuide: false
ExtraDetails: false
UseCache: false
Exclude:
- bin/**/*
- db/schema.rb
- db/seeds.rb
@kwent
kwent / sftp.rb
Last active April 14, 2021 14:45
Create a ruby pseudo terminal (PTY) and invoke an interactive command (SFTP)
require 'pty'
require 'expect'
PTY.spawn('sftp username@sftp.domain.com:/uploads') do |input, output|
# Say yes to SSH fingerprint
input.expect(/fingerprint/, 2) do |r|
output.puts "yes" if !r.nil?
@ashrithr
ashrithr / kerberos_setup.md
Last active July 20, 2024 20:06
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@spuk-
spuk- / pip-search-urllib2
Created April 24, 2014 14:16
Patch for making "pip search" use proxy set via *_proxy environment variables.
--- /usr/lib/python2.6/site-packages/pip/commands/search.py.orig 2014-04-24 10:31:14.551357257 -0300
+++ /usr/lib/python2.6/site-packages/pip/commands/search.py 2014-04-24 10:57:17.522362125 -0300
@@ -1,5 +1,6 @@
import sys
import textwrap
+import urllib2
import pip.download
@@ -12,6 +13,22 @@
"UserData": {
"Fn::Base64": { "Fn::Join":["", [
"#!/bin/bash -ex\n",
"apt-get update\n",
"apt-get -y install python-setuptools\n",
"mkdir aws-cfn-bootstrap-latest\n",
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n",
"easy_install aws-cfn-bootstrap-latest\n",
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n",
"\n",
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@afternoon
afternoon / elb-sg-config.yaml
Created April 14, 2013 20:34
Security group and load balancer config file for Elastic Beanstalk. See http://tmblr.co/ZU9VxvibvDWI.
# vim: ft=yaml
# Elastic Load Balancer and Security Group configuration for the app
#
# - Allow anyone to connect to port 443 and office traffic to connect to
# port 22
# - Ensure all traffic is encrypted by configuring load balancer to listen on
# 443 and direct traffic to port 443 on app servers
# - Enable cookie-based session stickiness
# - Use /status for health check
# - Enable backend authentication policy by providing public key for cert