Skip to content

Instantly share code, notes, and snippets.

View Luxter77's full-sized avatar
💭
In the process of imploding

Lucas Daniel Velazquez M. Luxter77

💭
In the process of imploding
View GitHub Profile
@Luxter77
Luxter77 / .bashrc
Last active December 13, 2020 09:20
MY bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@Luxter77
Luxter77 / miss-key.sh
Created November 7, 2020 14:39
Fixes the mess I cause upon arrival :P
#!/bin/bash
apt-get update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' |
while read key; do
echo "K: $key"
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key" || apt-key adv --keyserver keyserver.debian.com --recv-keys "$key"
done
@Luxter77
Luxter77 / compress-video.sh
Created December 1, 2020 02:04
use ffmpeg to compress video to a specific size in MB
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "You must enter exactly 2 command line arguments"
echo "Usage: "`basename "$0"`" video [target size in mb]"
exit
fi
target_video_size_MB="$2"
origin_duration_s=$(ffprobe -v error -show_streams -select_streams a "$1" | grep -Po "(?<=^duration\=)\d*\.\d*")
#!/usr/bin/sh
if [ "$#" -ne 2 ]; then
echo "You must enter exactly 2 command line arguments"
echo "This script must be ran on the root dir of a git repo!"
echo "Usage: "`basename "$0"`" NEW_AUTHOR_NAME NEW_AUTHOR_EMAIL"
exit
fi
git filter-branch -f --env-filter 'GIT_AUTHOR_NAME="$0"; GIT_COMMITTER_NAME="$0"; GIT_AUTHOR_EMAIL="$1"; GIT_COMMITTER_EMAIL="$1";' HEAD
#/usr/bin/env python
import requests
import os
import re
from typing import List
from bs4 import BeautifulSoup
contraloria_py = 'https://djbpublico.contraloria.gov.py/'
@Luxter77
Luxter77 / urban->json.py
Last active February 4, 2021 19:31
Script that uses TOR to scrap definitions from the urban dictionary v0 api
#!/usr/bin/env python3
# coding: utf-8
#
# urban->json.py
#
# Copyright 2021 Luxter77 <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@Luxter77
Luxter77 / manually-disable-hfs-jounal-flag.c
Last active June 19, 2021 01:27
Disable hfs journaling by flipping bits on raw disk (bad idea, but sometimes nesesary when disk is on a poor state and you just want to do the thing)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <byteswap.h>
int main(int argc, char * argv[]) {
int fd = open(argv[1], O_RDWR);
@Luxter77
Luxter77 / AzureAD-Get-All.ps1
Last active April 30, 2022 20:18
i did this in a coffee overdose because you get ad access with 365 lol
Import-Module AzureAD -UseWindowsPowerShell
$AzureAdCred = Get-Credential
write-host -nonewline "Enter name for the output file: "
$Name = read-host
Connect-AzureAD -Credential $AzureAdCred | Out-Null;
@Luxter77
Luxter77 / ALBUMER-PP.ps1
Last active March 9, 2023 01:07
Script para concatenar audios
$ext = Read-Host " - Extension de los archivos a concatenar (sin el punto inicial)";
$mdir = "ESTE ES UN TEXTO PLACEHOLDER INVALIDO QUE NO DEVERIA EXISTIR EN TU COMPUTADORA 117843647349133%&&#4W31";
while ( -not ($mdir | Test-Path) ) { $mdir = (Read-Host " - Directorio que contiene los archivos a concatenar (relativo)" | Convert-Path ) };
Set-Location $mdir; Set-Location ".."
$nn = 1; $n = 0; $ns = "";
Get-ChildItem $mdir;
Write-Host "";
Get-childItem -File $mdir | Where-Object { $_.Extension.tolower() -like ".$ext" } | ForEach-Object {