Skip to content

Instantly share code, notes, and snippets.

Avatar

Shanthakumar 5hanth

View GitHub Profile
@5hanth
5hanth / install-docker.md
Created Sep 13, 2020 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
View install-docker.md

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@5hanth
5hanth / ssl-dhparams.pem
Created Jan 17, 2020
certbot ssl-dhparams.pem
View ssl-dhparams.pem
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----
@5hanth
5hanth / options-ssl-nginx.conf
Created Jan 17, 2020
certbot options-ssl-nginx.conf
View options-ssl-nginx.conf
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_protocols TLSv1.2 TLSv1.3;
View scrap.console.js
var proc = (count, index) => {
let submitBtn = document.evaluate(`//*[@id="auto_off"]/table[4]/tbody/tr[5]/td[2]/input`,document).iterateNext()
let selectInput = document.evaluate(`//*[@id="subdiv"]/tbody/tr[5]/td[2]/select`, document).iterateNext()
let options = selectInput.options
let indexInt = parseInt(index)
let currentOption = options[indexInt]
if(currentOption && currentOption.value == selectInput.value) {
if((indexInt - 1) < options.length) {
console.log(`click `, options[indexInt+1])
selectInput.selectedIndex = indexInt+1
View keybase.md

Keybase proof

I hereby claim:

  • I am 5hanth on github.
  • I am shanth (https://keybase.io/shanth) on keybase.
  • I have a public key ASC03EJZ-xQ8FkxxeRTCZC-HWnZSBwnXIWzf-vWLaxFQoAo

To claim this, I am signing this object:

@5hanth
5hanth / veg-rates.rb
Created Mar 18, 2017
Vegetable Price Chennai
View veg-rates.rb
#! /usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://www.livechennai.com/Vegetable_price_chennai.asp'))
table = doc.css("table.table-price tr")
parse = -> (i) { i.css('td').drop(1).map{|j| j.css('p')[0].content.strip.chop.strip}.join }
View keybase.md

Keybase proof

I hereby claim:

  • I am 5hanth on github.
  • I am shanth (https://keybase.io/shanth) on keybase.
  • I have a public key whose fingerprint is DE53 0326 5015 7A0B 7257 9D72 E3AD 5EAD 88EE 1A77

To claim this, I am signing this object:

@5hanth
5hanth / out.json
Last active Nov 16, 2019
Parse text of links to json in elisp
View out.json
{
"links": [
{
"href": "http:\/\/github.com",
"label": "Github"
},
{
"href": "http:\/\/stackoverflow.com",
"label": "Stackoverflow"
},
@5hanth
5hanth / format_mails.el
Created Feb 22, 2016
Format mails for interleaved response in emacs
View format_mails.el
(defun sha/format-mail-header ()
(interactive)
(with-current-buffer (current-buffer)
(let ((beg (region-beginning))
(end (region-end))
(fill-column 60))
(goto-char beg)
(insert "Hi,\n\n")
(forward-line 0)
(insert "---")
You can’t perform that action at this time.