Skip to content

Instantly share code, notes, and snippets.

View itsazzad's full-sized avatar
🎯
Focusing

Sazzad Hossain (Tushar) Khan itsazzad

🎯
Focusing
View GitHub Profile
@itsazzad
itsazzad / install-openssl.sh
Last active November 29, 2021 10:52 — forked from estshorter/install-openssl.sh
Install openssl on raspberry pi
#!/bin/bash -eu
OPENSSL_VER=3.0.0
mkdir openssl
cd openssl
wget https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz
tar xf openssl-${OPENSSL_VER}.tar.gz
cd openssl-${OPENSSL_VER}
./config zlib shared no-ssl3
@itsazzad
itsazzad / gh-org-clone-pull-create-add-push.sh
Last active August 25, 2021 01:33 — forked from davegallant/gh-clone-org
Git Organization: Clone Repo, Pull, Create Repo, Add Remote, Push
#!/usr/bin/env bash
# This script clones all repos in a GitHub org and pushes to the upstream
# It requires the GH CLI: https://cli.github.com
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org> <target>"
Ping all AWS EC2 IPs from http://ec2-reachability.amazonaws.com/
@itsazzad
itsazzad / 01.js
Created May 28, 2018 15:54 — forked from martinaglv/01.js
What do these functions do?
function whatDoesItDo(val){
return val ? 1 : 2;
}
@itsazzad
itsazzad / massInsertOrUpdate.php
Created May 2, 2016 10:51 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@itsazzad
itsazzad / Vagrantfile
Created December 16, 2015 18:13 — forked from jkrems/Vagrantfile
Simple vagrant setup with debian and puppet
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Map NFS uid/gid to current user. This can be used to create a
# user inside the VM with matching uid/gid which makes file access
# a lot easier.
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
@itsazzad
itsazzad / node-and-npm-in-30-seconds.sh
Created December 7, 2015 10:46 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@itsazzad
itsazzad / tor_curl.php
Created November 26, 2015 14:58 — forked from zachflower/tor_curl.php
How To Anonymize PHP cURL Requests Using Tor
<?php
$ip = '127.0.0.1';
$port = '9051';
$auth = 'PASSWORD';
$command = 'signal NEWNYM';
$fp = fsockopen($ip,$port,$error_number,$err_string,10);
if(!$fp) { echo "ERROR: $error_number : $err_string";
return false;
@itsazzad
itsazzad / gist:e61622b7c8250ed1a622
Last active August 29, 2015 14:27 — forked from boucher/gist:1750375
Stripe PHP simple example
<?php
require 'path-to-Stripe.php';
if ($_POST) {
\Stripe\Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");