Skip to content

Instantly share code, notes, and snippets.

View john-e's full-sized avatar
🎩
Code Magician

Engit Prabhat john-e

🎩
Code Magician
View GitHub Profile
@john-e
john-e / aws-update-tokens-mfa.sh
Created November 10, 2020 17:24
Create AWS Token when using MFA
#!/usr/bin/env bash
set -e
if [[ -z $AWS_MFA_DEVICE ]]; then
MFA_DEVICE=${1}
MFA_TOKEN=$2
else
MFA_DEVICE=${AWS_MFA_DEVICE}
MFA_TOKEN=${1}
@john-e
john-e / multiple_ssh_setting.md
Created August 11, 2019 20:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@john-e
john-e / lambda.webpack.config.js
Last active June 20, 2019 12:36
Webpack config for bundling lambdas in production
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
@john-e
john-e / curry.js
Last active May 30, 2017 12:22
Trying out curry function in javascript
function curry (fn, ...args) {
if (fn.length == args.length) return fn(...args);
return (...args2) => {
return curry(fn, ...[...args, ...args2]);
};
};
@john-e
john-e / rpi-barcode-reader.py
Created March 4, 2016 06:45
Display barcode using camera - Raspberry PI
##############################
#
# RPI bar code reader
# @author github.com/john-e
#
# @lib
# zbar - https://github.com/npinchot/zbar
##############################
import sys
@john-e
john-e / toggleWebcam.sh
Created December 4, 2015 17:30
script to enable/disable webcam, can be attached to keyboard shortcut
#!/bin/sh
# disable/enable integrated webcam
# working for Ubuntu 14.04 on Dell 3000/Lenovo G50-80
# @author Engit
status="$(lsmod | grep uvcvideo)"
message=''
if [ -z "$status" ];then
modprobe uvcvideo
message="Enabled"
@john-e
john-e / toggleTrouchPad.sh
Last active December 4, 2015 17:30
script to enable/disable touchpad, can be attached to keyboard shortcut
#!/bin/sh
# disable/enable touchpad
# working for Ubuntu 14.04 on Dell 3000/Lenovo G50-80
# @author Engit
status=$(synclient -l | grep TouchpadOff | awk '{print $3}')
#if synclient returns nothing use xinput
synclient=1
if [ -z $status ]; then