Skip to content

Instantly share code, notes, and snippets.

View mbledkowski's full-sized avatar
🤔
Coding

echo r"0xX4H" | rev mbledkowski

🤔
Coding
View GitHub Profile
@Maxopoly
Maxopoly / iptables.rule
Last active August 14, 2023 14:53
IP tables for Minecraft
#You probably want to do this in root to reduce the amount of sudos required
su -
#Install iptables if you haven't already
#Alternatively use packet manager of your choice
apt-get install iptables
#Allow all incoming traffic to begin with
iptables -P INPUT ACCEPT
#Clean out any existing input rules. You may also remove the "INPUT" argument and run only "iptables -F" to clear all chains. When doing so, make sure there are no rules in other chains that you still need (list via "iptables -L"), for example Oracle cloud servers will have preset rules, which should not be removed.
@devarajchidambaram
devarajchidambaram / spawn vs child_process
Created August 28, 2018 13:32
Difference between spawn and exec functions of child_process
Difference between spawn and exec functions of child_process
The Node.js Child Processes module (child_process) has two functions spawn and exec, using which we can start a child process to execute other programs on the system. Those new to child_process may wonder why there are two functions to do the same thing, and which one they should use. I'll explain the differences between spawn and exec to help you decide when to use what.
The most significant difference between child_process.spawn and child_process.exec is in what they return - spawn returns a stream and exec returns a buffer.
child_process.spawn returns an object with stdout and stderr streams. You can tap on the stdout stream to read data that the child process sends back to Node. stdout being a stream has the "data", "end", and other events that streams have. spawn is best used to when you want the child process to return a large amount of data to Node - image processing, reading binary data etc.
child_process.spawn is "asynchronously asynchr
@theramiyer
theramiyer / arch-arm-rpi3-b-plus.md
Last active April 23, 2024 21:11
Install Arch Linux (ARM) on Raspberry Pi 3 Model B+

Install Arch Linux (ARM) on Raspberry Pi B+

Created 17 Aug 2018

This is a simple installation that I did on my Raspberry Pi. Of course, this is only one of the many reasons to do it.

Here are my requirements:

@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active March 22, 2024 18:05
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@ladinu
ladinu / encryptedNixos.md
Last active March 1, 2024 07:19
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device
@matti
matti / add.sh
Created July 29, 2017 11:12
alpine docker add package from edge testing
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
x11vnc
@wojteklu
wojteklu / clean_code.md
Last active April 27, 2024 19:52
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@QinMing
QinMing / .zshrc
Last active March 10, 2024 22:17
.zshrc (lazy loading shell functions)
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
lazy_load() {
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it.
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time
# $1: space separated list of alias to release after the first load
# $2: file to source
# $3: name of the command to run after it's loaded
# $4+: argv to be passed to $3
@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq