This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For PowerShell 7+, because Foreach-Object -Parallel is used | |
# Based on https://github.com/HackerNews/API | |
# | |
function Get-YcombinatorFeed { | |
(Invoke-RestMethod -Method Get "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty") -as [array] | | |
Select-Object -First 5 | Foreach-Object -ThrottleLimit 5 -Parallel { | |
Invoke-RestMethod -Method Get ( "https://hacker-news.firebaseio.com/v0/item/{0}.json" -f $_ ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$name="creator/project" | |
$uri="$(Invoke-WebRequest -Method Get "https://api.github.com/repos/$name/releases/latest" | ConvertFrom-Json | Select-Object -ExpandProperty zipball_url)" | |
Invoke-RestMethod -Method Get -Uri $uri -OutFile last.zip | |
Expand-Archive -Path last.zip -DestinationPath $targetDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Simple test/help | |
if [[ "$#" == '0' ]] | |
then | |
echo -e '\nPlease Select File\n' | |
#Great, file selected.. Lets upload that.. | |
elif [[ "$#" == '1' ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
a="$(cat /sys/class/net/eth0/statistics/rx_bytes)" | |
b="$(cat /sys/class/net/eth0/statistics/tx_bytes)" | |
rx="$(echo "scale=3;$a/1024^3"|bc)" | |
tx="$(echo "scale=3;$b/1024^3"|bc)" | |
sum=$(echo "scale=3;$rx+$tx"|bc) | |
printf "\n\e[41mETH0_STATS:\e[0m \e[42m RX: $rx GB TX: $tx GB Su: $sum GB\e[0m\n\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Web Server + MPU9250 | |
*/ | |
#include <SPI.h> | |
#include <UIPEthernet.h> | |
#include <MPU9250_asukiaaa.h> | |
#include <TinyGPS.h> | |
#include <SoftwareSerial.h> | |
String AX = String("\"aX\":"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" == '0' ] | |
then | |
printf 'Enter Parametrs [up|down|show|status|ssh]\n' | |
elif [ "$1" == 'up' ] || [ "$1" == 'on' ] || [ "$1" == 'start' ] | |
then | |
sudo wg-quick up /etc/wireguard/wg0.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while IFS= read -r ip | |
do | |
snmpwalk -v1 -c public "${ip}" 1.3.6.1.4.1.14988.1.1.3.8.0 | awk -v ip="$ip" '{print ip"=>"$4/10"V"}' | |
done < <(cat ~/ip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
if ![[ -e ~/.config/mpv/mpf.conf]] | |
then | |
mkdir -pv ~/.config/mpv | |
echo 'LS1od2RlYz12YWFwaQotLXZvPXZhYXBpCi0teXRkbC1mb3JtYXQ9YmVzdHZpZGVvW2hlaWdodDw9PzcyMF1bZnBzPD0/NjBdW3Zjb2RlYyE9P3ZwOV0rYmVzdGF1ZGlvL2Jlc3QKLS12b2x1bWUtbWF4PTIwMAotLXNhdmUtcG9zaXRpb24tb24tcXVpdAo=' |base64 -d > ~/.config/mpv/mpv.conf | |
elif [[ -e ~/.config/mpv/mpv.conf]] | |
then | |
echo -e 'mpv.conf already exist, nothing to do.\\nBye :)' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mp4 \ | |
-map 0:1 \ | |
-c:a copy \ | |
-y output.m4a |
NewerOlder