Skip to content

Instantly share code, notes, and snippets.


Bogdan Kulbida kulbida

View GitHub Profile
View gist:4660d0f84df5fbe5c7c15d1c7c92dcb4
# basic pfctl control
# ==
# Related:
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
kulbida / dd-wrt.markdown
Created Feb 4, 2018 — forked from johnantoni/dd-wrt.markdown
DD-WRT on WRT54G + OpenVPN
View dd-wrt.markdown

for a Linksys WRT54G router (v2.0)

  1. download the openvpn firmware version from
  2. set you static ip to and connect directly to the router via ethernet cable, disconnect internet from the router.
  3. once connected, update the firmware with the one you just downloaded from the link above.
  4. once done, successfully, reboot.
  5. re-connect the internet cable.
  6. 99% of the time it will reboot, though there's a fine chance of bricking the router so if you can get one from a yardsale, cheaper that way.
  7. once booted, navigate browser to
  8. login, the username & password could be either root/root root/admin admin/admin admin/password root/password.
kulbida / nginx.conf
Created Sep 6, 2017 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048



Clicking links and buttons

click_link('Link Text')
kulbida /
Created Jan 23, 2016 — forked from RunnerRick/
How To Integrate Sails and Passport
kulbida / .ackrc
Created Nov 1, 2015
.ackrc for ack2
View .ackrc
View merge.rb
# Merging Scopes
# ==============
# The goal is to join two tables to get all the records where a scope on both
# side of the join is used. I used to do this with a `where()` in which I
# added some sql on the joined table. But, I wanted to use the existing scopes
# from the joining table. Turns out there's a `merge` method on a scope where
# you can merge with another scope without having to chain!
class Car < ActiveRecord::Base
has_and_belongs_to_many :people
View settimeout.js
// if we have
function do() {
// thing that takes 100ms - 2s depending on browser
// Instead of:
setInterval(do, 500) // pray it doesn't lock the browser
// Do this:
kulbida / hdd_usage.go
Last active Aug 29, 2015
Monitor disk usage and send notifications emails when it fills up. Script written in Go lang that can be compiled to executable file and run as a demon on the server. It will check the hdd every hour and will send emails with cycle of 1, 2, 4, 8, 16 and 32 hours.
View hdd_usage.go
package main
import (
View db.rake
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
epoch =
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}-#{epoch}.dump"