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
toddlers / listlinkswebpage.md
Last active Nov 22, 2017
list links in web pages
View listlinkswebpage.md
  • 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 soompi.com
      
    • Results
      git:master=⚡ lynx -listonly -dump soompi.com
      
View debug_tag_spaces.md

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
toddlers / ipv6off.md
Last active Nov 9, 2017
Disable IPV6
View ipv6off.md

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
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 0.0.0.0:443 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
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
vars:
@toddlers
toddlers / configure_queues.sh
Created Oct 12, 2017
RabbitMQ - Command Line Setup. Create queue, bindings, exchanges with rabbitmqadmin and rabbitmqctl
View configure_queues.sh
#!/usr/bin/env bash
URL="http://localhost:15672/cli/rabbitmqadmin"
VHOST="<>"
USER="<>"
PWD="<>"
QUEUE="<>"
FAILED_QUEUE="<>"
@toddlers
toddlers / postgresh.sh
Last active Oct 10, 2017
postgres_commands
View postgresh.sh
# 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();
View openvpn.sh
openvpn service create ubuntu 16.
systemctl start openvpn@aws-to-sl-dal.service
@toddlers
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 = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
View healhcheck.sh
#!/usr/bin/env bash
set -x
host="<IP_ADDRESS>"
port="22"
email="user@example.com"
subject="Script result"
if ping -i 3 -q -c 4 $host >/dev/null
then
You can’t perform that action at this time.