Skip to content

Instantly share code, notes, and snippets.

View skoky's full-sized avatar

Laco Skokan skoky

View GitHub Profile
@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active September 16, 2024 19:46
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
# https://superuser.com/a/1434648
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result
@pojntfx
pojntfx / main.sh
Last active August 1, 2022 09:38
Create a self-signed SSL certificate with SAN
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout server.key -out server.crt -subj "/CN=localhost" \
-addext "subjectAltName=DNS:localhost,DNS:*.webview.localhost,IP:100.64.154.251"
@ianfinch
ianfinch / rpi4-usb.sh
Last active July 7, 2024 01:54
Raspberry Pi 4 USB Gadget
#!/bin/bash
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget
# Based on:
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/
# - https://pastebin.com/VtAusEmf
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then
echo "Add the line dtoverlay=dwc2 to /boot/config.txt"
exit
fi
@Wavefarer42
Wavefarer42 / docker-compose.yml
Created January 22, 2019 10:04
MongoDB Charts (docker-compose)
version: "3.3"
services:
mongo:
image: mongo:4.1.1
restart: on-failure
command: --wiredTigerCacheSizeGB 3
ports:
# Charts db is available under port 27018 to not block the default mongo port
- "8082:8081"
@kekru
kekru / Docker connect to remote server.md
Last active September 9, 2024 02:50
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@LukasRypl
LukasRypl / setBandwidthAndDelay.sh
Last active November 21, 2017 08:58
Linux TC
#!/bin/bash
#
###############################################################################
# Script used for setting bandwidth and delay. #
###############################################################################
#
# bandwidth in kilobytes
BANDWIDTH="640"
# time to reach other server (RTT will be 2xlonger=40ms)
@gbaman
gbaman / HowToOTGFast.md
Last active July 28, 2024 15:22
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@xurizaemon
xurizaemon / youtube.sh
Last active November 9, 2018 02:25
Streaming to YouTube from Raspberry Pi via avconv with a Microsoft HD-3000 LifeCam.
#!/bin/bash
KEY=YOUR.KEYG-OESR-IGHT-HERE
URL=rtmp://a.rtmp.youtube.com/live2
while true ; do
avconv -ar 44100 -ac 2 -f s16le -i /dev/zero -f video4linux2 -s 640x360 -r 10 -i /dev/video0 -f flv "$URL/$KEY"
sleep 3
done
@mesonoxian
mesonoxian / zookeeper-kafka
Created May 27, 2015 07:01
Simple Zookeeper and Kafka init.d Startup Script
#! /bin/bash
### BEGIN INIT INFO
# Provides: kafka
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: kafka service
### END INIT INFO