sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in *.js; do mv "$x" "${x%.js}.jsx"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -fsSL https://get.docker.com/rootless | sh | |
# Content to be added to .bashrc | |
content='export PATH="$HOME/bin:$PATH"' | |
# Check if content already exists in .bashrc | |
if grep -Fxq "$content" ~/.bashrc; then | |
echo "Content for bin path already exists in .bashrc. Skipping addition." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://play.golang.org/p/JxqibtHkuO- | |
func chunkBy(items []string, chunkSize int) (chunks [][]string) { | |
for chunkSize < len(items) { | |
items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize]) | |
} | |
return append(chunks, items) | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using this composer in the machines that a specific app runs which opens the port for prometheus | |
# Using promtail collect logs and publish to external loki | |
version: '3.8' | |
networks: | |
monitoring: | |
driver: bridge | |
services: | |
cadvisor: |
Libp2p is one of most commonly used libraries across web3 infrasture. It exposes several metrics compatible with Prometheus.
The official github repo has Grafana dashboard json for a quick start.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ip neigh show dev wlan0 |
- Set screen blanking:
sudo raspi-config nonint do_blanking 0
- Set lingering:
sudo loginctl enable-linger $(whoami)
- If above two does not work
sudo setterm -powerdown 0
andsudo setterm -powersave off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var removeIllegalCharacters = function(input) { | |
return input | |
.replace(/=/g, '') | |
.replace(/\+/g, '-') | |
.replace(/\//g, '_'); | |
}; | |
var base64object = function(input) { | |
var inputWords = CryptoJS.enc.Utf8.parse(JSON.stringify(input)); | |
var base64 = CryptoJS.enc.Base64.stringify(inputWords); |
NewerOlder