Skip to content

Instantly share code, notes, and snippets.

View OEvgeny's full-sized avatar
🔮
Shading

Eugene OEvgeny

🔮
Shading
View GitHub Profile
@robwierzbowski
robwierzbowski / switch_to_npm_registry.sh
Last active July 18, 2023 16:46
Configure yarn to use the npm registry directly
#!/bin/bash
# Remove all settings in the .npmrc except the required auth token setting.
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
# Create a new .yarnrc that specifies the npm registry, or append to an existing one.
echo 'registry: https://registry.npmjs.org/' >> .yarnrc
# Remove and regenerate the yarn.lock. This should be identical to running `yarn upgrade`.
# If you are uncomfortable regenerating the yarn.lock file, you can comment out the next
@antmdvs
antmdvs / ReactHooks.code-snippets
Last active November 7, 2018 17:51
Snippets for React's *EXPERIMENTAL* `useState()` hook -- See https://reactjs.org/hooks
{
"useState()": {
"prefix": "us",
"scope": "javascript,javascriptreact,typescript,typescriptreact",
"body": [
"const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState($2);",
"$0"
],
"description": "React: useState()"
},
@allenyllee
allenyllee / install_tools.sh
Last active April 14, 2024 21:31
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
@DreaMinder
DreaMinder / A Nuxt.js VPS production deployment.md
Last active October 11, 2023 11:33
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active March 15, 2024 15:56
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@janogarcia
janogarcia / email_coding_guidelines.md
Last active March 13, 2024 12:13
Email Coding Guidelines
@andrzejressel
andrzejressel / aria2
Created January 2, 2014 10:37
init.d file for aria2c daemon (debian)
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c init script.
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.