Skip to content

Instantly share code, notes, and snippets.

@mastdiekin
mastdiekin / m3u8-to-mp4.md
Created November 25, 2020 16:31 — forked from tzmartin/m3u8-to-mp4.md
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
@mastdiekin
mastdiekin / node_nginx_ssl.md
Created November 25, 2020 21:45 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@mastdiekin
mastdiekin / ssh_wsl.txt
Created February 27, 2021 16:13 — forked from jaimehrubiks/ssh_wsl.txt
Make SSH work in WSL [Windows subsystem for Linux] (Tested in Ubuntu Oct 2018)
# 1. Reinstall open ssh server
sudo apt-get purge openssh-server
sudo apt-get install openssh-server
# 2. Install public key
# vim .ssh/authorized_keys blabla
chmod 400 .ssh/authorized_keys
# 3. Edit open ssh server config files
# Some settings are not needed, but these will help for sure to make it work
@mastdiekin
mastdiekin / uninstall_python3.MD
Created March 7, 2021 10:42 — forked from zhensongren/uninstall_python3.MD
How to uninstall python3 from Ubuntu

To list all python versions in default locations

ls /usr/bin/python*

To remove just python3 package

sudo apt-get remove python3.5

plus it's dependent packages

sudo apt-get remove --auto-remove python3.5

plus configuration and/or data files of python3

sudo apt-get purge python3.5

@mastdiekin
mastdiekin / cat.jpg
Created March 18, 2021 13:08 — forked from duhaime/cat.jpg
Color thief top colors
cat.jpg
@mastdiekin
mastdiekin / README.md
Created April 15, 2021 11:00 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
@mastdiekin
mastdiekin / _app.js
Created July 6, 2021 23:27 — forked from claus/_app.js
Restore scroll position after navigating via browser back/forward buttons in Next.js
import useScrollRestoration from "utils/hooks/useScrollRestoration";
const App = ({ Component, pageProps, router }) => {
useScrollRestoration(router);
return <Component {...pageProps} />;
};
export default App;
@mastdiekin
mastdiekin / App.js
Created July 16, 2021 14:53 — forked from shelldandy/App.js
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@mastdiekin
mastdiekin / web-servers.md
Created September 14, 2021 17:56 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mastdiekin
mastdiekin / next_nginx.md
Created September 21, 2021 19:01 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt