Skip to content

Instantly share code, notes, and snippets.

Avatar

Aggam Rahamim AggamR

View GitHub Profile
@AggamR
AggamR / polybar-mic-vol-module
Created Mar 31, 2021
a module for polybar to show mic volume
View polybar-mic-vol-module
[module/mic-volume]
type = custom/script
exec = echo "Mic Vol 🎙️: $(amixer sget Capture | grep "Front Left" | sed -n 2p | awk '{ print $5 }')"
interval = 2
@AggamR
AggamR / backup.sh
Created Mar 26, 2021
a script to automatically backup all files listed in the `/home/aggam/backups/foldersToBackup` file
View backup.sh
#!/bin/bash
[ -d /home/aggam/backups/folders$(date '+%d%B%Y') ] && rm -rf /home/aggam/backups/folders$(date '+%d%B%Y')
while read p; do
echo $p
mkdir /home/aggam/backups/folders$(date '+%d%B%Y')
cp -r $p /home/aggam/backups/folders$(date '+%d%B%Y')
done </home/aggam/backups/foldersToBackup
@AggamR
AggamR / sqrt.asm
Last active Feb 22, 2021
sqrt in TASM MS-DOS assembly. doesn't print result - just keeps it in memory.
View sqrt.asm
;Aggam Rahamim
IDEAL
MODEL small
STACK 100h
DATASEG
; --------------------------
; Your variables here
; --------------------------
smaller db 0
final db 0 ; final result
@AggamR
AggamR / primes.c
Created Feb 12, 2021
Finding prime numbers with C
View primes.c
#include <stdio.h>
int main( int argc, char *argv[]) {
if (argc < 2)
printf("must supply argument - range");
int devisors = 0, num, devisor, largest, range = atoi(argv[1]);
for (num = 7; num < range; num += 2) {