Skip to content

Instantly share code, notes, and snippets.

@guychouk
guychouk / README.md
Last active January 21, 2024 05:12
Simple code deployment via a Github Action that uses git and rsync.

Simple Deployment 🚀

  • Install nginx and rsync on the server (using Debian as an example):
apt install -y nginx rsync 
  • Add the github user:
adduser --disabled-password --gecos "" --home /home/github github
@guychouk
guychouk / zetz
Last active May 9, 2023 23:25
⚡️ Zetz: simple note taking
#!/usr/bin/env bash
#
# _______| |_ ____
# |_ / _ \ __|_ /
# / / __/ |_ / /
# /___\___|\__/___|
#
# A note taking app for the terminal.
#
@guychouk
guychouk / dev.sh
Created March 28, 2023 21:52
[Node.js] Run nodemon with ts-node and debugging
nodemon --watch src --exec 'node --require ts-node/register --inspect' src/app.ts
@guychouk
guychouk / main.c
Created September 28, 2022 00:21
🔍 Full Text Search text files using SQLite, written in C
#ifdef __APPLE__
#ifndef st_mtime
#define st_mtime st_mtimespec.tv_sec
#endif
#endif
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@guychouk
guychouk / main.c
Created September 28, 2022 00:13
Ncurses and popen example
/* install ncurses and compile in the following manner: */
/* gcc -std=c99 -Wpedantic -Wall -lncurses main.c */
#include <ncurses.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int height, width, ch;
@guychouk
guychouk / main.ts
Created September 26, 2022 00:22
Console app TypeScript skeleton 💀
import fs from 'fs';
import glob from 'glob';
import chalk from 'chalk';
import EventEmitter from 'events';
type Configuration = {
first: string;
last: string;
};
@guychouk
guychouk / msn-to-sqlite.py
Last active September 19, 2022 05:08
Insert MSN messenger chats XMLs to a SQLite DB.
'''
This script checks for the existence of a directory called "chats"
in the current working directory and looks for XML files to read.
Once the parsing is done, it creates an SQLite DB file, and a table
for storing the date, from, to, text and style attributes of the messages.
'''
import os
import sys
@guychouk
guychouk / README.md
Created August 21, 2022 13:38 — forked from natterstefan/README.md
NODE | macOS fix node-gyp

Research | macOS fix node-gyp

Node

Update asdf

asdf plugin-update --all
asdf update
@guychouk
guychouk / scrape.sh
Created June 19, 2022 10:32
🌄 Scrape IMGs from HTML page using html-xml-utils.
#!/bin/sh
# Here is the original URL used to test this on:
# http://www.ghibli.jp/info/013251/
curl -s $1 | hxwls | grep -E "(jpg|png)" | grep -v thumb | xargs -I{} curl -s -O {}
@guychouk
guychouk / install.sh
Last active June 19, 2022 09:42
LEMP Installation with PHP8
#!/bin/bash
apt update
apt upgrade
apt install gnupg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
apt update
apt install -y \