Skip to content

Instantly share code, notes, and snippets.

Harish Karumuthil harish2704

Block or report user

Report or block harish2704

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
@harish2704
harish2704 / express-dump-server.js
Created Jan 23, 2020
A dummy express server which will dump headers , url , method & body of the request
View express-dump-server.js
const express = require('express')
const app = express()
const port = process.env.PORT || 3002
app.use(express.text());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(function( req, res ){
const data = {
method: req.method,
@harish2704
harish2704 / new-bash-session
Created Jan 18, 2020
Create a new bash session and save/load all the command history in current directory
View new-bash-session
#!/usr/bin/env bash
export HISTFILE=$PWD/.bash_history
bash
@harish2704
harish2704 / gen-cert.sh
Last active Jan 21, 2020
Generate ROOT CA and self signed certificates from localhost
View gen-cert.sh
#!/usr/bin/env bash
if [ -z "$1"]; then
echo "Usage: gen-cert.sh <domainname>"
exit 1
fi
DomainName="$1";
echo "## Generating Root CA key - Onetime process"
@harish2704
harish2704 / CUDA-Tesla-p100-Colab.txt
Last active Dec 30, 2019
ROCm vs CUDA performance comparison based on training of image_ocr example from Keras
View CUDA-Tesla-p100-Colab.txt
```
python3 examples/image_ocr.py
Using TensorFlow backend.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4479: The name tf.truncated_normal is deprecated. Please use tf.random.truncated_normal instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
View myutils.sh
#!/usr/bin/env bash
fonts_for_lang(){
fc-list :lang=$1
}
sshInTabs(){
logins="$@"
for i in $logins; do
View capacitance.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harish2704
harish2704 / snmp_count_process.sh
Created Dec 28, 2018
Count number of process matching given process name and arguments using snmp protocol
View snmp_count_process.sh
#!/bin/bash
listProcessNameMib=.1.3.6.1.2.1.25.4.2.1.2
listProcessArgsMib=.1.3.6.1.2.1.25.4.2.1.5
snmpHost=$1
snmpCommunity=$2
shift
shift
processName=$@
@harish2704
harish2704 / zypper_dup_print_urls.py
Created Oct 1, 2018
parallel downloads while doing zypper distribution upgrade
View zypper_dup_print_urls.py
#!/usr/bin/env python2
"""
This script will print package urls which need to be downloaded for 'distrubution upgrade'
Printed urls can be used for downloading packages in parallel.
For eg: we can use GNU parallel commanline tool along with wget/curl for parallel downloading
python2 zypper_dup_print_urls.py | parallel --tmuxpane -j4 --colsep ' ' mkdir -p '{1}/{2}' \; cd '{1}/{2}' \; wget -c {3}
will download packages with 4 simultaneous downloads
"""
@harish2704
harish2704 / json_format.sh
Created Sep 25, 2018
Pretty print / format JSON from STDIN using nodejs. single line solution.
View json_format.sh
node -e "console.log( JSON.stringify( JSON.parse(require('fs').readFileSync(0) ), null, 1 ))"
# Exapmle usage
# echo unformated.json | node -e "console.log( JSON.stringify( JSON.parse(require('fs').readFileSync(0) ), null, 1 ))"
@harish2704
harish2704 / dbus_handler.py
Last active Apr 21, 2018 — forked from DarkXanteR/dbus_handler.py
Python DBus handle hibernate, sleep and resume
View dbus_handler.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'xanter'
#from datetime import datetime
import signal
import time
import dbus
import gobject
import urllib2
You can’t perform that action at this time.