Skip to content

Instantly share code, notes, and snippets.

Subhash Chandran subwiz

  • Chennai, India
View GitHub Profile
@subwiz
subwiz / loc.sh
Created Sep 27, 2017
LOC of Go packages
View loc.sh
#!/bin/bash
# Install: https://github.com/warmans/golocc
for f in $(ls)
do
if [ -d "$f" ]; then
cd $f
golocc --no-vendor ./...
cd ..
@subwiz
subwiz / add-border.sh
Last active Jul 28, 2017
Imagic Magick script to add border to images. To install Imagic Magick: `brew update && brew install imagemagick`.
View add-border.sh
#!/bin/sh
for i in "$@"; do
echo Processing "$i" '=>' "x-$i"
convert "$i" -shave 5x5 -bordercolor black -border 5 "x-$i"
done
View Dockerfile
FROM debian
RUN mkdir -p /app/conf
# Assumption: Go generated project binary `prjbinary`
COPY prjbinary /app/prjbinary
COPY docker/conf/db.toml /app/conf/db.toml
# entrypoint.sh executes /app/prjbinary
# Before execution, based on MYENV, copies configs from vault to /app/conf/
@subwiz
subwiz / convert.sh
Last active May 23, 2017
Go HTTP client using pkcs12 certificate
View convert.sh
#!/bin/sh
## First convert .p12 cert to certificate and key .pem files:
openssl pkcs12 -in cert.p12 \
-clcerts -nokeys -out usercert.pem
openssl pkcs12 -in cert.p12 \
-nocerts -out userkey.pem -nodes
View dynamodb.rb
# Do `gem install aws-sdk`
require 'aws'
AWS.config(:access_key_id => 'ACCESS_KEY', :secret_access_key => 'SECRET_KEY')
db = AWS::DynamoDB.new
table = db.tables['subwiz_table'].load_schema
item = table.items.create(id: "subwiz")
item.attributes.add(followers: ["Ariel", "Mermaid"])
item.attributes.add(following: ["Sunny", "Leone"])
@subwiz
subwiz / gist:dff5daccce97c57958ec
Created Sep 16, 2014
C# Example for Creating Freshdesk Ticket With Attachment
View gist:dff5daccce97c57958ec
using System;
using System.IO;
using System.Net.Http;
namespace HttpClientFDApi
{
class FreshdeskTicketAttachmentApi
{
static void Main(string[] args)
{
View debug.sh
#!/bin/sh
set -vx
echo Enabled Debug
You can’t perform that action at this time.