Skip to content

Instantly share code, notes, and snippets.

View thekingofbandit's full-sized avatar
🏠
Working from home

Mohammad Khanafi thekingofbandit

🏠
Working from home
View GitHub Profile
@thekingofbandit
thekingofbandit / 000-Cheat-Sheets.md
Created January 28, 2023 18:12 — forked from JoshuaEstes/000-Cheat-Sheets.md
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@thekingofbandit
thekingofbandit / m3u8-to-mp4.md
Created December 17, 2021 02:34 — 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
@thekingofbandit
thekingofbandit / inlinesvgzoom.jsx
Created August 24, 2021 00:34
inline svg jsx
import React from "react";
import { ReactSVGPanZoom } from "react-svg-pan-zoom";
import { makeStyles } from "@material-ui/core/styles";
import Grid from "@material-ui/core/Grid";
import Diagram from "../components/Diagram";
const svgPanZoom = require("svg-pan-zoom");
const useStyles = makeStyles((theme) => ({
root: {
flexGrow: 1
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-mp3-a/vpid/bbc_radio_one/format/pls.pls
#EXTINF:-1,BBC - Radio 2
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-mp3-a/vpid/bbc_radio_two/format/pls.pls
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-mp3-a/vpid/bbc_radio_three/format/pls.pls
#EXTINF:-1,BBC - Radio 4
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-mp3-a/vpid/bbc_radio_fourfm/format/pls.pls
#EXTINF:-1,BBC - Radio 4 LW
@thekingofbandit
thekingofbandit / docker-compose.yml
Created July 27, 2021 08:20 — forked from crazyoptimist/compose.yaml
MongoDB Docker Deployment
version: "3.1"
services:
mongodb:
container_name: mongo
image: mongo
volumes:
- ./db_data/:/data/db/
ports:
- 27017:27017
restart: always
import { useState, useEffect } from 'react';
// Usage
function App() {
// Call our hook for each key that we'd like to monitor
const happyPress = useKeyPress('h');
const sadPress = useKeyPress('s');
const robotPress = useKeyPress('r');
const foxPress = useKeyPress('f');
@thekingofbandit
thekingofbandit / ReactClassComponentWithMethods.jsx
Last active February 7, 2021 11:12
React Class Component Methods
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class reactClassComponentWIthMethods extends Component {
constructor(props) {
super(props);
}
componentWillMount() {

SSH keys

Create

ssh-keygen -o

You can view the created files (one without extension and one with .pub) under ~/.ssh/. When creating several of them, you may want to rename them appropriately (e.g. work, pers...).

Add them

to the relevant github account: https://github.com/settings/ssh/new

Configuration

The configuration file for ssh is usually not created by default so we create it:

/*****************
* cellBlockA.js *
*****************
*
* Good morning, Dr. Eval.
*
* It wasn't easy, but I've managed to get your computer down
* to you. This system might be unfamiliar, but the underlying
* code is still JavaScript. Just like we predicted.
*
@thekingofbandit
thekingofbandit / Documentation.md
Created September 23, 2020 16:21 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs