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 / finances.R
Last active May 7, 2024 17:50
💸 Analyzing my finances CSV with R
# function that reverses a string by characters
reverse_chars <- function(string)
{
# split string by characters
string_split = strsplit(string, split = "")
# reverse order
rev_order = nchar(string):1
# reversed characters
reversed_chars = string_split[[1]][rev_order]
# collapse reversed characters
@guychouk
guychouk / lemp.sh
Last active May 7, 2024 17:49
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 \
@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 / fts.c
Last active May 7, 2024 17:52
🔍 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>