Skip to content

Instantly share code, notes, and snippets.

View jhordyess's full-sized avatar
🎯
Focusing

Jhordy Gavinchu jhordyess

🎯
Focusing
View GitHub Profile
@jhordyess
jhordyess / get_vscode_extensions.sh
Created August 26, 2023 16:07
Generate a list of your Visual Studio Code extensions and their Marketplace URLs with this bash script
#!/bin/bash
# Get the list of installed extensions
extensions=$(code --list-extensions)
# Visual Studio Code Marketplace base URL
base_url="https://marketplace.visualstudio.com/items?itemName="
# Iterate through the extensions and generate URLs
for extension in $extensions
@jhordyess
jhordyess / clean.sh
Created December 23, 2022 13:47
Delete all "node_modules" directories.
find ./ -type d -iname node_modules -exec rm -rv {} \;
@jhordyess
jhordyess / devcontainer.json
Created September 1, 2022 03:57
Setting project folder for TeX Live as remote container in VS Code
{
"name": "texlive",
"image": "jhordyess/texlive",
"extensions": ["James-Yu.latex-workshop"],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.latex.autoBuild.run": "never",
@jhordyess
jhordyess / zsh-ohmyzsh-p10k.sh
Created August 23, 2022 20:48
Instalation zsh, Oh My Zsh, Powerlevel10k theme; and git, zsh-syntax-highlighting, zsh-autosuggestions plugins.
#!/bin/bash
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i "s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"powerlevel10k\/powerlevel10k\"/g" ~/.zshrc
@jhordyess
jhordyess / run.sh
Created August 2, 2022 17:44
Temporal Nginx server with Docker
#!/bin/bash
printf "Absolute path: "
read dir
echo "Running in http://localhost:80"
docker run -it --rm -v ${dir}:/usr/share/nginx/html/ -p 80:80 nginx
@jhordyess
jhordyess / devcontainer.json
Last active December 12, 2023 16:57
Setting project folder for PlatformIO as dev container in VS Code
{
"name": "PlatformIO",
"image": "jhordyess/platformio",
"shutdownAction": "none",
"customizations": {
"vscode": {
"settings": {
"C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: LLVM, ColumnLimit: 0, SortIncludes: false}",
"C_Cpp.updateChannel": "Insiders",
"terminal.integrated.defaultProfile.linux": "zsh",
@jhordyess
jhordyess / docker-composer.yml
Last active August 2, 2022 01:47
Odoo installation with multi-container
services:
odoo-db:
image: postgres:14
restart: always
environment:
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=EZT_hvh-abt2dvm9wdk
- POSTGRES_DB=postgres
odoo:
image: odoo:15
@jhordyess
jhordyess / new-user-ssh.sh
Created March 7, 2022 01:19
Create a new user and add the SSH public key for Raspberry Pi.
#!/bin/bash
printf "What new username to use? "
read user
printf "Which is the public key? "
read public_key
if [ "$user" != "" -a "$public_key" != "" ]; then
# create user, password required
sudo adduser $user
# add the new user to the gpio group
sudo usermod -a -G gpio $user
@jhordyess
jhordyess / useful-conda.sh
Last active March 6, 2022 22:52
useful Conda commands
# After installation, to enable the use of conda commands with bash:
conda init bash #you need to close and reopen terminal afterwards
# Create the "env1" environment with python 3.7
conda create --name env1 python=3.7 -y
# Install 3 basic packages for VSCode in the "env1" environment
conda install --name env1 notebook ipykernel autopep8
# Change to use conda commands in the "env1" environment
conda activate env1
# Find the "ipykernel" package
conda search ipykernel
@jhordyess
jhordyess / useful-platformio.sh
Last active March 6, 2022 22:52
useful PlatformIO CLI commands
# Initialize project for Arduino Uno R3
pio project init --board uno --ide vscode
# Build
pio run
# Upload
pio run -t upload
# Connect to the serial port monitor
pio device monitor
# Search "irremote" library for "atmelavr" platform and "arduino" framework
pio lib search irremote -p atmelavr -f arduino