Skip to content

Instantly share code, notes, and snippets.

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

obar1 obar1

🏠
Working from home
View GitHub Profile
@mbostock
mbostock / .block
Last active July 30, 2024 03:51
The Gist to Clone All Gists
license: gpl-3.0
@jbub
jbub / squash-commits.sh
Created June 12, 2013 15:31
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@fomightez
fomightez / remove blank lines regex.md
Last active September 17, 2024 01:31
remove all blank lines using regular expressions
wget -r --no-parent -A '*CHANGES*' http://ws.com
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" hbase-0.98.6-cdh5.3.6.CHANGES.txt | sort | uniq -i -z | uniq
@cipri7329
cipri7329 / zeppelin0.6-cloudera5.7.md
Last active January 29, 2021 03:38
Zeppelin notebook with Cloudera
@itod
itod / split_keyboards.md
Last active November 14, 2024 19:07
Every "split" mechanical keyboard currently being sold that I know of
@obar1
obar1 / mplayer extract
Created June 25, 2017 17:57
to extract images frome video
mplayer -vo null -ao null -frames 0 -identify "file.mpg"
// LOOK FOR id_length
//8000
mpayer -vo jpeg -sstep 5 -endpos 8000 -nosound "file.mpg"
@zentralwerkstatt
zentralwerkstatt / instructions.md
Last active July 5, 2021 18:58
SSH into Linux Subsystem for Windows
  • In /etc/ssh/sshd_conf, set UsePrivilegeSeparation to no
  • In /etc/ssh/sshd_conf, temporarily enable plaintext passwords
  • In /etc/ssh/sshd_conf, change port (e.g. to 23) to avoid confusion with Windows SSH server
  • sudo service ssh restart
  • Add alternative port as a new rule to Windows firewall
  • On the client: ssh-copy-id user@server
  • In /etc/ssh/sshd_conf, re-disable plaintext passwords

To fix Could not load host key ... error:

  • sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
@obar1
obar1 / youtube-ls-playlist.sh
Created September 10, 2017 18:31 — forked from zmwangx/youtube-ls-playlist.sh
List video URIs in a YouTube playlist.
#!/usr/bin/env bash
# Takes a YouTube URI to a playlist (fairly liberal, it's fine as long
# as the playlist id can be extracted), and prints a list of URIs in a
# YouTube playlist.
#
# Requires youtube-dl 2014.10.24, tested on youtube-dl
# 2014.11.02.1. Feature subject to change.
youtube-dl -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://youtube.com/v/_'
@dentechy
dentechy / WSL-ssh-server.md
Last active October 8, 2024 10:48
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: