I hereby claim:
- I am ascalabro on github.
- I am ascalabro (https://keybase.io/ascalabro) on keybase.
- I have a public key ASCfgtfTWKjgzi7sf4dXRly_pg0fZv1pGsHXhwtX-q4cygo
To claim this, I am signing this object:
<?php | |
/** | |
* Please be aware. This gist requires at least PHP 5.4 to run correctly. | |
* Otherwise consider downgrading the $opts array code to the classic "array" syntax. | |
*/ | |
function getMp3StreamTitle($streamingUrl, $interval, $offset = 0, $headers = true) | |
{ | |
$needle = 'StreamTitle='; | |
$ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36'; |
I hereby claim:
To claim this, I am signing this object:
A Pen by Roch Bouchayer on CodePen.
#!/bin/sh | |
MINIMUM_ARGS=2 # Require a database name and table name(s). Change to 1 if need to do whole database and only provide database name | |
# These are the two servers being worked on | |
# Change configuration here | |
FROM_MYSQL_HOST=localhost | |
FROM_USERNAME=myuser | |
FROM_PASSWORD=mypas |
#!/bin/sh | |
MINIMUM_ARGS=1 | |
if [ $# -lt $MINIMUM_ARGS ] | |
then | |
echo "Usage: $0 database_name [table_names]" | |
else | |
echo "Dumping $* to file..." | |
mysqldump -hhostname -uadmin -ppassword $* > /tmp/dbdump.sql | |
echo "DONE" | |
echo "Importing dump file..." |
#!/bin/sh | |
# Adds line to your hosts file | |
# Tested in Mac OS X El Capitan | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $BASH_SOURCE <new IP address> <new hostname>" >&2 | |
exit 1 | |
fi | |
awk '1; END {print "'$1' '$2'"}' /etc/hosts > tmp && sudo mv tmp /etc/hosts |
#!/bin/sh -e | |
# | |
echo "*****************************************************" | |
echo "Default usage runs this command:" | |
echo " sudo tail -f /var/log/mysql/mysql.log" | |
echo "Optional usage: $0 ### --- Show last ### of lines" | |
echo "Optional usage will run this command instead: " | |
echo " sudo tail --lines=### /var/log/mysql/mysql.log | more" | |
echo "*****************************************************" |
#! /bin/bash | |
sudo du -ah /var | sort -n -r | head -n 50 > largeFiles.txt | |
cat largeFiles.txt |
#!/bin/bash | |
set -e | |
SITENAME="mywebsite.com" | |
echo "Received commit at" $HOSTNAME | |
echo "executing post-receive hook" | |
GIT_WORK_TREE=/var/www/${SITENAME}/public_html git checkout -f | |
LATESTREV=$(cat refs/heads/master) | |
echo "latest revision $LATESTREV" | |
DIRECTORY="/var/www/backups/${SITENAME}/" | |
if [ ! -d $DIRECTORY ]; then |
@echo off | |
:: Usages | |
:: >conw w #switch to wireless interface | |
:: >conw e #switch to ethernet interface | |
IF %1% == e ( | |
echo Switching to Ethernet | |
netsh interface set interface name="Local Area Connection" admin=enabled | |
netsh interface set interface name="Wireless Network Connection" admin=disabled | |
GOTO :DONE | |
) |