Skip to content

Instantly share code, notes, and snippets.

View theSoberSobber's full-sized avatar
🐢

theSoberSobber

🐢
View GitHub Profile
@theSoberSobber
theSoberSobber / profile.ps1
Last active March 25, 2024 18:22
Powershell Profile
# https://kevinlinxc.medium.com/how-hard-could-installing-autocomplete-for-powershell-be-4c8a2cbc69be
# Update-Module PowerShellGet -Force
# Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
Invoke-Expression (& 'C:\Users\hp\scoop\shims\starship.exe' init powershell --print-full-init | Out-String)
Import-Module PSReadLine
Import-Module -Name Terminal-Icons
Set-PSReadLineOption -PredictionSource History
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r'
@theSoberSobber
theSoberSobber / c4.txt
Created March 16, 2024 07:52 — forked from turbo/c4.txt
This file has been truncated, but you can view the full file.
http://95.229.228.109:81/cgi-bin/faststream.jpg?stream=half&fps=15&rand=COUNTER
http://196.218.116.139:80/cgi-bin/viewer/video.jpg
http://213.240.185.79:50001/cgi-bin/faststream.jpg?stream=half&fps=15&rand=COUNTER
http://187.145.51.144:8083/cgi-bin/viewer/video.jpg
http://78.33.151.99:8888/mjpg/video.mjpg?COUNTER
http://84.244.69.110:80/cgi-bin/viewer/video.jpg
http://88.247.179.172:60001/cgi-bin/snapshot.cgi?chn=0&u=admin&p=&q=0
http://76.70.29.102:2080/mjpg/video.mjpg?COUNTER
http://73.138.177.206:1024/mjpg/video.mjpg?COUNTER
http://188.235.132.145:80/cgi-bin/viewer/video.jpg
@theSoberSobber
theSoberSobber / connect-adb-tcpip.cpp
Last active March 4, 2024 19:53
Meant to be used with my hotkeydaemon sxhkd-win32 to be able to be used in conjuction with scrcpy, in addition one can use the ip widget app on android to make it even more seamless.
#include <windows.h>
#include <iostream>
#include <string>
#include <winuser.h>
HWND g_hTextBox;
HWND g_hButton;
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@theSoberSobber
theSoberSobber / main.sh
Last active January 13, 2024 06:00
Termux CronTab Script Codeforces, (crontab -e, */15 * * * * /data/data/com.termux/files/home/monitor/data/main.sh >> /data/data/com.termux/files/home/monitor/data/logs.txt 2 > &1, nohup crond -n &>/dev/null &)
#!/bin/bash
# Function for colored logging
debug() {
local mode="$1"
local log="$2"
local color="$3"
case "$mode" in
fetch) echo -e "\e[1;36m[Fetch]\e[0m $log" ;;
@theSoberSobber
theSoberSobber / HP Pavilion Gaming Laptop 15-ec1xxx.xml
Created December 7, 2023 12:31 — forked from ibLeDy/HP Pavilion Gaming Laptop 15-ec1xxx.xml
NBFC config for the HP Pavilion Gaming Laptop 15-ec1xxx
<?xml version="1.0"?>
<FanControlConfigV2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NotebookModel>HP Pavilion Gaming Laptop 15-ec1xxx</NotebookModel>
<Author>bLeDy</Author>
<EcPollInterval>1000</EcPollInterval>
<ReadWriteWords>false</ReadWriteWords>
<CriticalTemperature>68</CriticalTemperature>
<FanConfigurations>
<FanConfiguration>
<ReadRegister>88</ReadRegister>
@theSoberSobber
theSoberSobber / config.yaml
Created August 16, 2023 14:14
GlazeWM Config
gaps:
inner_gap: 2
outer_gap: 4
general:
# Whether to show floating windows as always on top.
show_floating_on_top: false
bar:
height: "30px"
@theSoberSobber
theSoberSobber / scraper-demo.py
Created June 19, 2023 06:35
Scrapes site and filters contest using Regex
# importing the required libraries.
import requests
from bs4 import BeautifulSoup
import re
# Requesting the HTML from the web page.
page = requests.get("https://books.toscrape.com/")
# Selecting the data.
soup = BeautifulSoup(page.content, "html.parser")
@theSoberSobber
theSoberSobber / server.json
Last active May 4, 2024 04:05
current ip of my home server, with a max lag of 60 seconds
{"ip": "116.72.201.188"}
@theSoberSobber
theSoberSobber / rr sir ke madhur gaane.py
Created March 22, 2023 06:13
python scrape.py > out
import sys, json;
import urllib.request
import bs4 as bs;
ap=json.load(urllib.request.urlopen("https://codeforces.com/api/user.status?handle=18o3"))["result"];
for i in ap:
phtml = bs.BeautifulSoup(urllib.request.urlopen( f'https://codeforces.com/contest/{i["contestId"]}/submission/{i["id"]}'), "html.parser");
try:
out="";
code = phtml.body.find('pre', attrs={'id':'program-source-text'}).text;
for lno in range(len(code.splitlines())-7, len(code.splitlines())):
struct IOPre {
static constexpr int TEN = 10, SZ = TEN * TEN * TEN * TEN;
std::array<char, 4 * SZ> num;
constexpr IOPre() : num{} {
for (int i = 0; i < SZ; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i * 4 + j] = static_cast<char>(n % TEN + '0');
n /= TEN;
}