Skip to content

Instantly share code, notes, and snippets.

View obar1's full-sized avatar
:octocat:

obar1 obar1

:octocat:
View GitHub Profile
@obar1
obar1 / drop-wsl2-Identifier.sh
Last active June 26, 2024 13:25
drop Identifier
find . -name "*.Identifier" -type f -print0 | xargs -0 rm
#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI: https://cli.github.com
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
[[ $# -eq 0 ]] && echo >&2 "missing arguments: ${USAGE}" && exit 1
#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI: https://cli.github.com
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
@davidteren
davidteren / nerd_fonts.md
Last active July 5, 2024 07:58
Install Nerd Fonts via Homebrew [updated & fixed]
@richiefrost
richiefrost / AzureDatalakeDemo.py
Created September 10, 2019 17:01
Pandas read_csv from Azure Data Lake with interactive login
from azure.datalake.store import core, lib, multithread
import pandas as pd
class ADLSHelper:
def __init__(self, store_name='mystorename'):
"""
When initializing this helper, it will prompt you to do an interactive login to connect to your data lake store.
It uses Azure Active Directory for authentication, and you use the token returned from
your login process to connect to your Azure Data Lake instance.
You can also authenticate with username/password or ServicePrincipal for production.
@xterat
xterat / Compile-Hadoop-2.8.md
Last active October 8, 2018 12:08
Compile Hadoop-2.8

Compile Hadoop-2.8 on Ubuntu 16.04

  1. Install some dependencies:

    sudo apt -y install gcc*
    sudo apt -y install cmake
    sudo apt -y install glibc-headers
    sudo apt -y install gcc-c++
    sudo apt -y install zip-devel
@dentechy
dentechy / WSL-ssh-server.md
Last active June 13, 2024 15:17
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:
@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/_'
@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 / 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"