curl -sI | grep -i Content-Length | awk '{print $2/1024}'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# selects an android device | |
PROGNAME=$(basename $0) | |
UNAME=$(uname) | |
DEVICE_OPT= | |
for opt in "$@" | |
do | |
case "$opt" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# read -e -p "Enter File URL: " fileUrl | |
# if [ -z "${fileUrl}" ];then | |
# echo "Missing File URL!" | |
# exit | |
# fi | |
APP_NAME=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## arrow up | |
"\e[A":history-search-backward | |
## arrow down | |
"\e[B":history-search-forward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# read -e -p "Enter File URL: " fileUrl | |
# if [ -z "${fileUrl}" ];then | |
# echo "Missing File URL!" | |
# exit | |
# fi | |
bytesToHuman() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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?'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello World | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |