Skip to content

Instantly share code, notes, and snippets.

Suresh Prajapati toddlers

Block or report user

Report or block toddlers

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
toddlers /
Last active Nov 22, 2017
list links in web pages
  • For listing the links inside a web page
    • Install lynx using brew install lynx on mac
    • Run following command for listing the links
      lynx -listonly -dump
    • Results
      git:master=⚡ lynx -listonly -dump

makefile has a very stupid relation with tabs , all actions of every rule are identified by tabs. and No 4 spaces dont make a tab , only a tab makes a tab...

to check i use the command

cat -e -t -v  makefile_name

it shows the presence of tabs with ^I and line endings with $ both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.

toddlers /
Last active Nov 9, 2017
Disable IPV6

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

net.ipv6.conf.lo.disable_ipv6 = 1

cat /proc/sys/net/ipv6/conf/all/disable_ipv6
toddlers / haproxy.cfg
Created Oct 28, 2017
Haproxy config file for SSL and basic authentication
View haproxy.cfg
userlist logsusers
user username insecure-password passowrd
frontend https_external
acl search_logsusers http_auth(logsusers)
bind ssl crt net.pem npn http/1.1 no-sslv3 no-tls-tickets
http-request auth unless search_logsusers
reqadd X-Forwarded-Proto:\ https
toddlers / ansible_gitclone_issue_fix
Created Oct 28, 2017
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
View ansible_gitclone_issue_fix
# Problem:
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
- hosts: webserver
toddlers /
Created Oct 12, 2017
RabbitMQ - Command Line Setup. Create queue, bindings, exchanges with rabbitmqadmin and rabbitmqctl
#!/usr/bin/env bash
toddlers /
Last active Oct 10, 2017
# check master/slave status
# if f its master otherwise its slave
select pg_is_in_recovery();
#check lag status
SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::INT;
# check slave status
SELECT pg_last_xlog_receive_location();
openvpn service create ubuntu 16.
systemctl start openvpn@aws-to-sl-dal.service
toddlers / function.js
Created Aug 31, 2017 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
View function.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = '';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
#!/usr/bin/env bash
set -x
subject="Script result"
if ping -i 3 -q -c 4 $host >/dev/null
You can’t perform that action at this time.