Skip to content

Instantly share code, notes, and snippets.

@edoshor
edoshor / replace-ssh-key.sh
Created March 21, 2020 17:28
A small utility to automate replacement of ssh key on servers
#!/usr/bin/env bash
###################
# A small utility to automate replacement of ssh key on servers.
#
# USE WITH GREAT CARE !!!
# Author: edoshor@gmail.com
set -e
set +x
@edoshor
edoshor / day.go
Last active September 8, 2019 04:51
package main
import (
"database/sql"
"fmt"
"log"
"strings"
_ "github.com/go-sql-driver/mysql"
)
# frozen_string_literal: true
require "ipaddr"
module ActionDispatch
# This middleware calculates the IP address of the remote client that is
# making the request. It does this by checking various headers that could
# contain the address, and then picking the last-set address that is not
# on the list of trusted IPs. This follows the precedent set by e.g.
# {the Tomcat server}[https://issues.apache.org/bugzilla/show_bug.cgi?id=50453],
<html class="js adownload cssanimations csstransitions webp webp-alpha webp-animation webp-lossless wf-roboto-n4-active wf-opensans-n4-active wf-opensans-n6-active wf-roboto-n3-active wf-roboto-n5-active wf-active" dir="ltr" loc="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>(1) WhatsApp</title>
<meta name="viewport" content="width=device-width">
<meta name="google" content="notranslate">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="Quickly send and receive WhatsApp messages right from your computer.">
<meta name="og:description" content="Quickly send and receive WhatsApp messages right from your computer.">
@edoshor
edoshor / enhance_user.py
Created April 27, 2015 08:36
Enhance user profile on signup
import analytics
from piplapis.search import SearchAPIRequest
def enhance_segment_user(user):
resp = SearchAPIRequest(email=user.email,
first_name=user.first_name,
last_name=user.last_name,
show_sources='matching').send()
@edoshor
edoshor / pipl.rb
Created November 20, 2014 17:48
Pipl.com Ruby Api
require_relative 'lib/piplapis/search'
request = PiplApi::SearchAPIRequest.new({api_key: 'samplekey', email: 'test@example.com'})
begin
response = request.send
# All good!
rescue PiplApi::SearchAPIError => e
puts e
end