Skip to content

Instantly share code, notes, and snippets.

View -
/home/abuhenasobuj/Personal/Documents/gist/bash_history-0817.md -p -c -d Backupd bash_history on আগস্ট 2017
@sobujbd
sobujbd / install.php
Created Sep 30, 2017 — forked from tschoffelen/install.php
A simple PHP script that automatically downloads and unzips the latest version of Wordpress in the current directory (./), so that I don't have to download it and upload it to my server through FTP manually.
View install.php
<?php
echo '<pre>';
echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL;
// Download file
file_put_contents('wp.zip', file_get_contents('http://wordpress.org/latest.zip'));
$zip = new ZipArchive();
$res = $zip->open('wp.zip');
if ($res === TRUE) {
@sobujbd
sobujbd / unzip.php
Created Nov 14, 2017 — forked from trajche/unzip.php
Unzip a file on one.com with PHP
View unzip.php
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';
View curl get file size.md

curl -sI | grep -i Content-Length | awk '{print $2/1024}'

View git-archive.sh
#!/bin/bash
git init # on the root of the project folder
git add .
git commit -m "git archive"
FOLDERNAME="backup"
CURRENTFOLDERNAME="${PWD##*/}"
FILENAME="archive_$(date +%d)_$(date +%m)_$(date +%Y)_$(date +%I)$(date +%M)$(date +%S)"
mkdir -p "$FOLDERNAME"
git archive HEAD --format=zip --prefix=$CURRENTFOLDERNAME/ > backup/$CURRENTFOLDERNAME-$FILENAME.zip
echo Saved as $CURRENTFOLDERNAME-$FILENAME.zip
@sobujbd
sobujbd / runavd.sh
Last active Oct 6, 2018
Run Android Emulator (AVD) from Bash Script
View runavd.sh
#!/bin/bash
function selectAVD()
{
echo "Available AVDs:"
$emuDir/emulator -list-avds
echo "Which AVD would you like to use?"
read myAVD
ARRAY=($($emuDir/emulator -list-avds))
isIn=false
@sobujbd
sobujbd / filesize.sh
Created Oct 7, 2018
File Size | Shell Script
View filesize.sh
#!/bin/bash
# read -e -p "Enter File URL: " fileUrl
# if [ -z "${fileUrl}" ];then
# echo "Missing File URL!"
# exit
# fi
bytesToHuman() {
@sobujbd
sobujbd / .inputrc
Created Oct 7, 2018
Bash history search with up-arrow, down-arrow
View .inputrc
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
@sobujbd
sobujbd / adb_screencap.sh
Created Oct 15, 2018
ADB Screen Capture
View adb_screencap.sh
#!/bin/bash
# read -e -p "Enter File URL: " fileUrl
# if [ -z "${fileUrl}" ];then
# echo "Missing File URL!"
# exit
# fi
APP_NAME=$1