Skip to content

Instantly share code, notes, and snippets.

View mustafaturan's full-sized avatar

Mustafa Turan mustafaturan

View GitHub Profile
@mustafaturan
mustafaturan / .env
Last active September 2, 2024 19:34
Set monoflake node id from ip address (digitalocean)
APP_ENV=production
MONOFLAKE_NODE=0
@mustafaturan
mustafaturan / activate_spark_session.ipynb
Last active August 6, 2023 21:55
Bash script to run jupyter notebook for python3 and pyspark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Monitoring Libp2p

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.

@mustafaturan
mustafaturan / connected-devices.sh
Created July 17, 2023 00:19
Wifi access point connected devices
#!/bin/bash
ip neigh show dev wlan0
@mustafaturan
mustafaturan / prevent-sleep.md
Last active July 12, 2023 04:28
Prevent raspberry pi 4b to sleep
  1. Set screen blanking: sudo raspi-config nonint do_blanking 0
  2. Set lingering: sudo loginctl enable-linger $(whoami)
  3. If above two does not work sudo setterm -powerdown 0 and sudo setterm -powersave off
@mustafaturan
mustafaturan / docker-compose-agent.yaml
Last active July 22, 2023 04:52
Install Monitoring Tools with Docker
# 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:
@mustafaturan
mustafaturan / untar-remote-tgz-file.md
Created June 28, 2022 23:18
Untar remote file to local

Untar remote file to local directory

Downloading a tar.gz file and extracting it after the download completes might consume a lot of disk space and time. It is possible to write tar.gz file directly as input to tar command and untar it to directory directly from remote url.

wget -qO- your_link_here | tar -xvz -C /target/directory
@mustafaturan
mustafaturan / mount-ssd.md
Last active June 27, 2022 20:09
Mount SSD with Fstab User Write Permissions
# Create the folder to mount drive 
sudo mkdir /mnt/storage

# Set user/group perms to write
chown -R pi:pi /mnt/storage

# find the driver properties
sudo blkid
@mustafaturan
mustafaturan / update-limit.sh
Last active June 12, 2022 08:03
Set max open files limit on mac
sudo sysctl -w kern.maxfiles=75000
sudo sysctl -w kern.maxfilesperproc=75000
ulimit -S -n 75000