Skip to content

Instantly share code, notes, and snippets.

@ncochard
ncochard / babel-webpack.md
Last active April 2, 2025 18:22
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@mosquito
mosquito / README.md
Last active May 21, 2025 19:56
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 17, 2025 04:41
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@AfroThundr3007730
AfroThundr3007730 / 00-repoupdate.md
Last active February 7, 2025 14:52
Configuration files for local yum and apt repositories. (Retired)

Note: This gist is historical now that I've moved this to a proper repo: AfroThundr3007730/syncrepo

Below are configuration files for creating upstream and downstream yum and apt repositories. These can be hosted on a CentOS, Debian, or Ubuntu system and served via rsync or http. The only requirements are rsync and a webserver, such as apache, and also debmirror. Note that not all required setup steps are listed here (TODO: add setup guide).

Filename Description Notes
00-syncrepo.sh Combined all-in-one repo sync script. Still alpha. Last tested: v1.6.5
@ultim8k
ultim8k / vim-multiline-comment.md
Last active June 16, 2025 09:30
(un) comment multiple lines vim

From: http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

For those tasks I use most of the time block selection.

Put your cursor on the first # character, press Ctrl``V (or Ctrl``Q for gVim), and go down until the last commented line and press x, that will delete all the # characters vertically.

For commenting a block of text is almost the same: First, go to the first line you want to comment, press Ctrl``V, and select until the last line. Second, press Shift``I``#``Esc (then give it a second), and it will insert a # character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/# in the second step instead.

@joepie91
joepie91 / vpn.md
Last active June 15, 2025 15:48
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@dlangille
dlangille / create.sh
Last active December 6, 2024 13:35
snmp v3 clients for LibreNMS
For more up to date information, see https://dan.langille.org/2023/08/16/configuration-of-net-mgmt-net-snmpd-on-freebsd/
Do this on the snmpd client:
service snmpd stop
net-snmp-config --create-snmpv3-user -ro -A 'AuthPass' -X 'PrivPass' -a SHA -x AES MyRoGroup
chmod go-rwx /var/net-snmp/snmpd.conf /usr/local/share/snmp/snmpd.conf
verify MyRoGroup is in /usr/local/share/snmp/snmpd.conf
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active June 16, 2025 09:36
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@violetlight
violetlight / firefox.md
Last active January 16, 2023 15:40
Firefox settings for security and privacy

Addons

  • NoScript - manually whitelist javascript execution on a per-site and per-domain basis
  • HTTPS Everywhere - automatically use https everywhere it's available
  • Cookie Monster - manage your cookies
  • Ghostery - alerts user about tracking bugs on visited pages
  • FireGloves - impedes fingerprinting-based tracking
  • Ref Control - Control what gets sent as the HTTP Referer on a per-site basis
  • UAControl - Control what gets sent as the User-Agent on a per-site basis
  • BetterPrivacy - deletes flash cookies
  • [MD5 Reborned Hasher
@denji
denji / nginx-tuning.md
Last active June 11, 2025 12:16
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.