Skip to content

Instantly share code, notes, and snippets.

View guilt's full-sized avatar
🎯
Focusing

Karthik Kumar Viswanathan guilt

🎯
Focusing
View GitHub Profile
// https://stackoverflow.com/questions/11355353/how-can-i-convert-qbasic-play-commands-to-something-more-contemporary
// file: play2wav.c by Alexey Frunze
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#ifndef M_PI
@guilt
guilt / fzdecrypt.c
Last active September 9, 2020 21:14
FileZilla Password Decrypter
#include <stdio.h>
const char fzKey[] = "FILEZILLA1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int fzKeyLen = 45;
char *decrypt(const char *str, char *targetStr) {
int i = 0, oriLen = 0, pos;
if (!str || !targetStr) return 0;
*targetStr = 0;
for (; str[oriLen]; ++oriLen)
@guilt
guilt / git-squash
Last active April 29, 2022 16:58
git-squash
#!/bin/sh
N=${1:-2}
git reset --soft HEAD~$N &&
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
@guilt
guilt / RESETDMA.VBS
Last active December 28, 2022 22:23
Windows Script to reset DMA mode on Optical Drives
' Visual Basic Script program to reset the DMA status of all ATA drives
' Copyright © 2006 Hans-Georg Michna
' Version 2006-03-14
' Works in Windows XP, probably also in Windows 2000 and NT.
' Does no harm if Windows version is incompatible.
If MsgBox("This program will now reset the DMA status of all ATA drives with Windows drivers." _
@guilt
guilt / client.tsx
Last active December 28, 2022 22:26
Deno React App
import React from "https://esm.sh/react@17.0.2";
const App = () => {
return (
<h1>Hello Deno Land!</h1>
);
};
export default App;
@guilt
guilt / html2pdf.sh
Last active December 28, 2022 22:27
PhantomJS based HTML to PDF renderer
#!/bin/sh
set -e
HFILE=$1
[ -f "$HFILE" ] || { echo "HTML File not found."; exit 1; }
PFILE=$( echo "${HFILE}" | sed 's/.html/.pdf/g' )
TMPDIR=${TMPDIR:-${TEMP}}
TMPDIR=${TMPDIR:-${TMP}}
@guilt
guilt / p2j.go
Last active December 28, 2022 22:28
Parquet to JSON CLI
//p2j: Parquet to JSON
package main
import (
"encoding/json"
"flag"
"fmt"
log "github.com/sirupsen/logrus"
"os"
@guilt
guilt / unroll.c
Last active February 24, 2023 04:24
Header-Only Efficient Loop Unrolling in C and C++.
// Demo of unroll.h
#include "unroll.h"
int main()
{
int v;
U_unroll(v, 17, {
printf("Up Unroll\n");
});
@guilt
guilt / env.nu
Last active May 11, 2023 22:39
NuShell Windows
# Custom Aliases
alias dir = ls
alias del = rm
alias ren = mv
alias move = mv
alias rmdir = rm
alias rd = rmdir
alias open = start
@guilt
guilt / authy.spec
Created June 17, 2023 21:15
Authy Snap into RPM
%define _snapid H8ZpNgIoPyvmkgxOWw5MSzsXK1wRZiHn
%define _snaprev 18
Name: authy
Version: 2.2.3
Release: 1%{?dist}
Summary: Two factor authentication desktop application
ExclusiveArch: x86_64
License: Proprietary
URL: https://authy.com/