Skip to content

Instantly share code, notes, and snippets.

Dan Sosedoff sosedoff

Block or report user

Report or block sosedoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 0_before.txt
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy DROP)
@sosedoff
sosedoff / 1_simple.go
Created Jul 16, 2016
Golang Custom Struct Tags Example
View 1_simple.go
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@sosedoff
sosedoff / main.go
Created Mar 11, 2015
geoip2 golang test
View main.go
package main
import (
"log"
"net"
"os"
"github.com/gin-gonic/gin"
"github.com/sosedoff/geoip2-golang"
)
@sosedoff
sosedoff / simplecov_parser.rb
Last active Dec 26, 2015
SimpleCov html coverage file parser
View simplecov_parser.rb
require "nokogiri"
class CoverageParser
attr_reader :files,
:files_count,
:coverage_percent,
:avg_hit,
:lines_total,
:lines_relevant,
:lines_missed,
@sosedoff
sosedoff / static_server.go
Last active Dec 25, 2015
Static server for html development.
View static_server.go
package main
import(
"os"
"fmt"
"net/http"
"github.com/jessevdk/go-flags"
)
type ServerOptions struct {
@sosedoff
sosedoff / gem-version.go
Last active Dec 25, 2015
Terminal tool to quickly check gem versions
View gem-version.go
package main
import(
"os"
"fmt"
"net/http"
"io/ioutil"
"encoding/json"
)
@sosedoff
sosedoff / rails_logs.go
Created Jun 25, 2013
Capture IPs from heroku log drain
View rails_logs.go
package main
import (
"fmt"
"os"
"bufio"
"regexp"
)
var IP_REGEX = regexp.MustCompile(`([\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3})`)
@sosedoff
sosedoff / squid.conf
Created Dec 14, 2012
Squid clean configuration
View squid.conf
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl localhost src 192.168.0.0/16 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@sosedoff
sosedoff / __readme.md
Created Nov 23, 2012 — forked from jimeh/__readme.md
Let's not localize programming languages. Please >_<
View __readme.md

Let's not localize programming languages. Please >_<

Feel free to fork and expand and/or add more languages as an example to why this would be horrible, and I'll add them here :)

@sosedoff
sosedoff / net_ssh_session.rb
Created Oct 30, 2012
Net::SSH::Session experiments
View net_ssh_session.rb
require 'net/ssh'
require 'net/ssh/shell'
require 'open3'
module Net
module SSH
class SessionCommand
attr_reader :command, :output, :exit_code
# Initialize a new session command
You can’t perform that action at this time.