Skip to content

Instantly share code, notes, and snippets.

View ajtatum's full-sized avatar

AJ Tatum ajtatum

View GitHub Profile
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@webkul
webkul / docker-db-container-backup.sh
Last active February 15, 2024 21:02
Bash script to take backup of all the databases of docker database container from the host.
#!/bin/bash
set -x
## Mention your database container name
container_name=
## Mention your mysql root password
mysql_root_password=
DATE=`date +%F-%H-%M-%S`
@mishari
mishari / continental-usa-states-bb
Created July 3, 2014 14:41
Bounding box of states in USA from OSM's Nominatim
[{"place_id":"97994878","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"161950","boundingbox":["30.1375217437744","35.0080299377441","-88.4731369018555","-84.8882446289062"],"lat":"33.2588817","lon":"-86.8295337","display_name":"Alabama, United States of America","place_rank":"8","category":"boundary","type":"administrative","importance":0.83507032450272,"icon":"http:\/\/nominatim.openstreetmap.org\/images\/mapicons\/poi_boundary_administrative.p.20.png"}]
[{"place_id":"97421560","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"162018","boundingbox":["31.3321762084961","37.0042610168457","-114.818359375","-109.045196533203"],"lat":"34.395342","lon":"-111.7632755","display_name":"Arizona, United States of America","place_rank":"8","category":"boundary","type":"administrative","importance":0.83922181098242,"icon":"http:\/\/nominatim.openst
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@agustinustheo
agustinustheo / add-nginx-conf.sh
Created December 8, 2020 18:35
A shell script to add NGINX configurations automatically.
#!/bin/bash
conf_path="/etc/nginx/conf.d/$1.conf"
if [ -f "$conf_path" ]
then
conf_text=`cat $conf_path`
if [[ "$conf_text" == *"$2"* ]] || [[ "$conf_text" == *"localhost:$3"* ]]
then
echo "Proxy route or localhost port has been used, please manually reconfigure your Nginx configuration."
else
@rajadain
rajadain / ConEmu-MaterialTheme.xml
Last active November 6, 2023 08:57
ConEmu Material Theme
<key name="Colors" modified="2015-12-10 22:46:43" build="151210">
<value name="Count" type="dword" data="00000001"/>
<key name="Palette1" modified="2015-12-10 22:46:43" build="151210">
<value name="Name" type="string" data="Material Theme"/>
<value name="ColorTable00" type="dword" data="004d4335"/>
<value name="ColorTable01" type="dword" data="006b60eb"/>
<value name="ColorTable02" type="dword" data="008de8c3"/>
<value name="ColorTable03" type="dword" data="0095ebf7"/>
<value name="ColorTable04" type="dword" data="00c4cb80"/>
<value name="ColorTable05" type="dword" data="009024ff"/>
@kladov
kladov / getZodiacSign.js
Last active October 17, 2023 04:39
Zodiac sign (javascript)
/**
* Return zodiac sugn by month and day
*
* @param day
* @param month
* @return {string} name of zodiac sign
*/
function getZodiacSign(day, month) {
var zodiacSigns = {