Skip to content

Instantly share code, notes, and snippets.

View eslam-mahmoud's full-sized avatar

Eslam Mahmoud eslam-mahmoud

  • US
View GitHub Profile
@eslam-mahmoud
eslam-mahmoud / DaVinci Resolve
Last active April 10, 2022 14:57
DaVinci Resolve on ubuntu linux how to solve codac problem, record on OBS, mov/mkv/mp4 problem
recod in OBS
export as MP4
if you have exported to mkv
convert it first to mp4
$fmpeg -i ./source/3.mkv -c:v libx264 -preset ultrafast -crf 0 ./mp4/3.mp4
convert to mov
$ ffmpeg -i raw_footage.mp4 -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov footage_mjpeg.mov
import in davinci resolve
export as youtube file (will come out without audio)
Encode back
@eslam-mahmoud
eslam-mahmoud / main.go
Created January 20, 2020 17:13
split images into folders - backup
package main
import (
"io/ioutil"
"log"
"os"
)
func main() {
files, err := ioutil.ReadDir("./Camera")
@eslam-mahmoud
eslam-mahmoud / unlikeAllFacebookpages.js
Last active July 31, 2019 18:14
Unlike all facebook pages
// 1- go to https://www.facebook.com/pages/?category=liked
// 2- inspect to find the unlike class name
// 3- add it to unlikeClassName var and run that gist
var unlikeClassName = '_43rm'
Array.from(document.getElementsByClassName(unlikeClassName)).forEach((el) => {
el.click();
});
@eslam-mahmoud
eslam-mahmoud / Dockerfile
Created July 14, 2019 20:18
sample docker file for tutorial
FROM golang:1.8
WORKDIR /app
COPY ./executable /app/executable
CMD ["./executable"]
@eslam-mahmoud
eslam-mahmoud / Makefile
Created July 14, 2019 20:17
sample #2 Makefile for tutorial
NAME=executable
VERSION=1
GO_IMAGE=eslammahmoud/test:$(VERSION)
# Docker container that will be used to create the vendor folder and binary
GO_ENV=docker run -it --rm -v $(PWD):/app -w /app golang:1.8
all: push
# Create the executable file
@eslam-mahmoud
eslam-mahmoud / Makefile
Last active July 14, 2019 17:11
sample Makefile for tutorial
REPO_TAG=3.0.0
all: build
i18n-nodejs-$(REPO_TAG):
curl https://github.com/eslam-mahmoud/i18n-nodejs/archive/$(REPO_TAG).zip -L -o i18n-nodejs-$(REPO_TAG).zip
unzip i18n-nodejs-$(REPO_TAG).zip
build: i18n-nodejs-$(REPO_TAG)
cd i18n-nodejs-$(REPO_TAG); npm install
@eslam-mahmoud
eslam-mahmoud / concurent_sequential.js
Last active June 26, 2019 15:25
Multiple Simultaneous Ajax Requests (concurrent sequential requests)
var ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
var stop = false;
function go(index, step) {
if (stop) {
console.log('Stoped', index, step);
return;
}
if (index > ids.length) {
console.log('Done');
@eslam-mahmoud
eslam-mahmoud / gist:bddece7a407ea920e3600e48756bbd34
Last active January 30, 2021 17:04
create Certbot SSL on Docker Nginx on AWS - digitalocean
https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-dns-validation-with-certbot-dns-digitalocean-on-ubuntu-20-04
https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx
-> https://certbot-dns-digitalocean.readthedocs.io/en/stable/
certbot certonly --dns-digitalocean --dns-digitalocean-credentials ~/digitaloceanapikey.ini --preferred-challenges=dns -d=example.com -d=*.example.com
nano /etc/nginx/sites-available/x-app
ln -s /etc/nginx/sites-available/x-app /etc/nginx/sites-enabled/x-app
sudo service nginx configtest
sudo service nginx restart
@eslam-mahmoud
eslam-mahmoud / go-get-it.go
Last active February 18, 2019 16:23
create 50 worker pool what will do Async get request to URL and print result
package main
import (
"fmt"
"sync"
"strconv"
"net/http"
"io/ioutil"
)
var wg sync.WaitGroup
@eslam-mahmoud
eslam-mahmoud / load.php
Last active January 22, 2019 16:28
console.chat
var domain = window.location.hostname;
console.log('Welcome to console.chat! You\'re chatting with other people who visited ' + domain + ' and opened their browser\'s console!');
console.log('To send a message it must be in this format: send(\'your message here\')\nExample: If you want to say "Hey, what\'s up?" send(\'Hey, what\'s up?\')');
console.log('Created by @DaltonEdwards :)');
var messageCount = 0;
function loadMessages() {
var request = new XMLHttpRequest();
request.open('GET', 'https://console.chat/api/read.php?domain=' + domain, true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {