Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi avipars

🎯
Focusing
View GitHub Profile
@avipars
avipars / recover.py
Created November 26, 2024 11:58
Recover ursl from great suspender
# script to ask user for the txt file name and then clean the URLS and save in new txt file
def main():
# ask user for the txt file name
file_name = input("Enter the txt file name: ")
parse_file(file_name)
def parse_file(file_name):
with open(file_name, "r") as file:
# read the file
@avipars
avipars / control.sh
Last active September 9, 2024 21:09
Pi Zero W LED Control
#!/bin/bash
# turn on LED
echo 1 | sudo tee /sys/class/leds/ACT/brightness
# turn off LED
echo 0 | sudo tee /sys/class/leds/ACT/brightness
# heatbeat blink
echo heartbeat | sudo tee /sys/class/leds/ACT/trigger
@avipars
avipars / audio_watermark_spectrogram.ipynb
Last active September 1, 2024 11:47
audio_watermark_spectrogram.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@avipars
avipars / watermarker.py
Created August 11, 2024 17:46
Watermark a PDF file (all pages)
import os
from PyPDF2 import PdfReader, PdfWriter
def main():
mark_it_up("watermark.pdf", "/source/", "/output/")
def mark_it_up(watermark_file, pdf_folder, output_folder):
"""
@avipars
avipars / cuts.pl
Created July 1, 2024 17:13
Prolog Backtracking and Cuts
% tail length
len([],A,A). %base
len([_|T],A,R) :-
A1 is A + 1,
len(T, A1, R).
% params to send
len(L,Res):- len(L,0, Res).
0
00
01
02
03
04
05
06
07
08
@avipars
avipars / styles.css
Created November 21, 2023 12:31
GGA Reddit theme backup
/*
Version 3.0
Edited by Flexxkii
Stylesheet by Cryptonaut
Last modified: 15 MAR 2015
Details: This is a custom template made by /u/Cryptonaut.
Find out more on /r/Naut.
-------------------------------------------------------------------------- */
*,:before,:after {
@avipars
avipars / mouse.js
Created November 13, 2023 19:53
Daydream VR
var noble = require("noble");
var robot = require("robotjs");
var begMovement = [];
var initPos = [];
var moving = false;
var clicked = false;
robot.setMouseDelay(20);
noble.on('stateChange', function(state) {
@avipars
avipars / pkgcmd -l
Last active July 21, 2023 10:30
Get package names off a tizen wearable
C:\tizen-studio\tools>sdb shell
sh-3.2$ pkgcmd -l
system apps pkg_type [tpk] pkgid [com.samsung.alti-barometer] name [Alti-Barometer] version [2.0.9] storage [internal]
system apps pkg_type [tpk] pkgid [com.samsung.d-calculator-wc1] name [Calculator] version [20.0.6] storage [internal]
system apps pkg_type [rpm] pkgid [com.samsung.unit-test-sensor] name [Unit Test sensor Applications] version [1.0.0] storage [internal]
system apps pkg_type [rpm] pkgid [com.samsung.bluetooth-testmode] name [Bluetooth Testmode] version [0.0.14storage [internal]
system apps pkg_type [rpm] pkgid [com.samsung.w-clock-viewer] name [W-Clock-Viewer] version [0.2.15] storage [internal]
system apps pkg_type [rpm] pkgid [org.tizen.chromium-efl] name [Tizen Web Engine based on Chromium] version [69.0.3497.106] storage [internal]
system apps pkg_type [rpm] pkgid [org.tizen.net-popup] name [Network popup] version [3.0] storage [internal]
syst
@avipars
avipars / main.py
Last active March 30, 2023 04:04
Recover files from the marvelous suspender
# script to ask user for the txt file name and then clean the URLS and save in new txt file
def main():
# ask user for the txt file name
file_name = input("Enter the txt file name: ")
parse_file(file_name)
def parse_file(file_name):
with open(file_name, "r") as file:
# read the file