Skip to content

Instantly share code, notes, and snippets.

@mano8
mano8 / pi_mount_usb.md
Created February 9, 2020 09:47 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install pi-bluetooth
You may then need to update the firmware used in the Bluetooth module, which is done by running the following:
sudo apt-get install bluez bluez-firmware

Installation guide for debian server running vemonitor.

For this, i use an old asus eee pc 1000H laptop, see here for more info.

Install of debian 11

Downlad debian from debian.org the latest stable version for 32 bits systems. Use balenaEtcher to create a bootable usb. To boot from external media you have to press Esc during the BIOS boot splash screen and select the right installation medium. Complete the installation and upgrade the system : Pass to root user : $ su -

Emoncms installlation (debian11/nginx)

Above is the nginx configuration to run emoncms on debian 11 with php7.4.

Prepare emoncms installation

Create the above paths needed from emoncms :

 # sudo mkdir /var/opt/emoncms/
 # sudo mkdir /var/opt/emoncms/phptimeseries/
 # sudo mkdir /var/opt/emoncms/phpfina/
@mano8
mano8 / linux ssh.md
Last active May 25, 2024 11:02
Installation of ssh server on linux

Install ssh-server

# sudo apt-get update # sudo apt-get install openssh-server

See status: # sudo systemctl status ssh

Backup the ssh configuration: # sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup

SetupTools Cheat Sheet

Create package from source

$ python setup.py sdist bdist_wheel

Check package

$ twine check dist/*

Upload pip package

$ twine upload dist/*

pip Cheat Sheet

This is a forked version from opensource.com By Moshe Zadka

@mano8
mano8 / repo-reset.md
Created May 24, 2023 08:03 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A

Django Cheat Sheet Commands

Django shell:

Project

Create project:

Create App:
python manage.py startapp app_name

@mano8
mano8 / CVE-2023-41892-POC.md
Created March 12, 2024 12:28 — forked from to016/CVE-2023-41892-POC.md
CVE-2023-41892 (Craft CMS Remote Code Execution) - POC

This Gist provides a Proof-of-Concept (POC) for CVE-2023-41892, a Craft CMS vulnerability that allows Remote Code Execution (RCE).

Overview

CVE-2023-41892 is a security vulnerability discovered in Craft CMS, a popular content management system. Craft CMS versions affected by this vulnerability allow attackers to execute arbitrary code remotely, potentially compromising the security and integrity of the application.

POC

This POC is depending on writing webshell, so finding a suitable folder with writable permission is necessary.