Skip to content

Instantly share code, notes, and snippets.

View UlisesGascon's full-sized avatar
😎
Focus on FOSS Projects!

Ulises Gascón UlisesGascon

😎
Focus on FOSS Projects!
View GitHub Profile
@UlisesGascon
UlisesGascon / README.md
Created July 21, 2024 15:21
Bash script to create an isolated environment using namespaces and cgroups

Isolate Script

This script creates an isolated environment using Linux namespaces and cgroups, executes a provided Bash script, and then cleans up the environment. It ensures that any changes made within the isolated environment do not affect the host system.

How It Works

  1. Argument Check: The script checks if a Bash script file is provided as an argument.
  2. File Existence Check: It verifies if the provided file exists.
  3. Cgroup Creation: A cgroup is created to limit the number of processes to 50.
  4. Namespace Creation: The script creates new PID and UTS namespaces using unshare.
@UlisesGascon
UlisesGascon / example.py
Created October 24, 2022 12:56 — forked from eddieantonio/example.py
Zero-dependency Python 3 and Node IPC using UNIX sockets
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import socket
import json
server_address = '/tmp/example.sock'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(server_address)
@UlisesGascon
UlisesGascon / commands_docusaurus_translation.md
Created July 7, 2022 13:44 — forked from FedericoTartarini/commands_docusaurus_translation.md
Source code for the YouTube video - Translate a Docusaurus website in multiple languages with its internationalization (i18n) support.

Initialize a new site

with npx @docusaurus/init@latest init website classic

Configure your site

i18n: {
    defaultLocale: 'en',
    locales: ['en', 'it'],
    localeConfigs: {
      en: {
@UlisesGascon
UlisesGascon / README.MD
Created June 7, 2022 06:30 — forked from lmarkus/README.MD
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@UlisesGascon
UlisesGascon / nvm_zsh.md
Created April 7, 2022 08:16
nvm in zsh always available
  1. git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
  2. Add the zsh-nvm plugin to your .zshrc folder

Full guide

@UlisesGascon
UlisesGascon / THANKS.md
Created January 6, 2022 19:01
Thank you! 💖

Thanks to all of you for making *.ulisesgascon.com possible

Special Thanks

Nextjs based subdomains

@UlisesGascon
UlisesGascon / do_setup.sh
Last active December 23, 2020 09:02
Digital Ocean with Docker Compose a Nodejs
#!/bin/sh
echo "START: Installing dependencies for Node, Docker and Docker Compose in DO"
cd /home
mkdir WORKSPACE
cd WORKSPACE
# Nodejs
# https://github.com/nodesource/distributions/blob/master/README.md
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
@UlisesGascon
UlisesGascon / database_magic.md
Created August 20, 2020 06:06
Dump, compare and check db integrity

Database Backup and comparation

Dump Postgres DB

pg_dump --data-only --inserts -h <DB_URL> -U <DB_USER> -f <FILE_NAME_TO_CREATE.sql> <DB_NAME>

Notes:

  • --data-only will dump only data to be inserted (not tables strcuture and relations)
  • --inserts will force to use INSERT statements and not COPY to avoid driver issues later on
@UlisesGascon
UlisesGascon / hack.sh
Last active March 6, 2020 11:48
David hasselhoff wallpaper 2020
#!/bin/sh
npm install --global wallpaper-cli
wallpaper https://octodex.github.com/images/privateinvestocat.jpg --scale=fit
npm uninstall --global wallpaper-cli
@UlisesGascon
UlisesGascon / important.md
Last active February 12, 2020 07:57
Nodejs February Security Release