Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Hard working 😄

Dawid Pośpiech rewida17

💭
Hard working 😄
  • Poland
View GitHub Profile
@rewida17
rewida17 / server.py
Created Nov 25, 2020 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
View server.py
#!/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):
@rewida17
rewida17 / get_latest_release.ps1
Last active Aug 31, 2020 — forked from lukechilds/get_latest_release.sh
PowerShell - Get latest release zip from GitHub
View get_latest_release.ps1
$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
@rewida17
rewida17 / goupload
Created May 8, 2020
Upload files to gofile.io via api. Required curl and jq
View goupload
#!/bin/bash
#Simple test/help
if [[ "$#" == '0' ]]
then
echo -e '\nPlease Select File\n'
#Great, file selected.. Lets upload that..
elif [[ "$#" == '1' ]]
then
@rewida17
rewida17 / ethstat.sh
Created Feb 28, 2020
interface stats based on /sys/class/net/eth0/statistics/
View ethstat.sh
#!/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"
@rewida17
rewida17 / MPU9250_ENC28J60
Last active Dec 8, 2019
Get data from MPU and print in JSON on site #arduino
View MPU9250_ENC28J60
/*
Web Server + MPU9250
*/
#include <SPI.h>
#include <UIPEthernet.h>
#include <MPU9250_asukiaaa.h>
#include <TinyGPS.h>
#include <SoftwareSerial.h>
String AX = String("\"aX\":");
@rewida17
rewida17 / wirewrap
Created Sep 2, 2019
simple "wrapper" around wg and wg-quick that can simplify tasks
View wirewrap
#!/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
View 123456
#!/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)
@rewida17
rewida17 / mpv_conf
Created May 4, 2019
chromebook Thinkpad 11e mpv.conf
View mpv_conf
#!/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 :)'
View extract-audio-from-video.sh
ffmpeg -i input.mp4 \
-map 0:1 \
-c:a copy \
-y output.m4a
View aesgcm
#!/bin/bash
#ENJOY
DL(){
conversations_http_downloader.py "$a"
}
#We are in /tmp?
if ! [[ "$PWD" == '/tmp' ]]
then
echo 'Go to /tmp'