Skip to content

Instantly share code, notes, and snippets.

View directentis1's full-sized avatar
💭
Super busy!

directentis1

💭
Super busy!
View GitHub Profile
@directentis1
directentis1 / rclone_manual_sync.sh
Created February 22, 2024 05:25
Credit: someone
#!/bin/bash
## One-way, immediate, continuous, recursive, directory synchronization
## to a remote Rclone URL. ( S3, SFTP, FTP, WebDAV, Dropbox, etc. )
## Optional desktop notifications on sync events or errors.
## Useful only for syncing a SMALL number of files (< 8192).
## (See note in `man inotifywait` under `--recursive` about raising this limit.)
## Think use-case: Synchronize Traefik TLS certificates file (acme.json)
## Think use-case: Synchronize Keepass (.kdbx) database file immediately on save.
## Think use-case: Live edit source code and push to remote server
@directentis1
directentis1 / donut_deobfuscated.c
Created January 2, 2024 17:02
Credit: Lex Fridman
int main() {
float A = 0, B = 0;
float i, j;
int k;
float z[1760];
char b[1760];
printf("\x1b[2J");
for(;;) {
memset(b,32,1760);
memset(z,0,7040);

Disk Speed Test (Read/Write): HDD, SSD Performance in Linux

From this article you’ll learn how to measure an input/output performance of a file system on such devices as HDD, SSD, USB Flash Drive etc.

I’ll show how to test the read/write speed of a disk from the Linux command line using dd command.

I’ll also show how to install and use hdparm utility for measuring read speed of a disk on Linux Mint, Ubuntu, Debian, CentOS, RHEL.

Take the average result: To get the accurate read/write speed, you should repeat the below tests several times (usually 3-5) and take the average result.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@directentis1
directentis1 / tp-link-ac600-ac1300-drivers-linux.md
Created September 12, 2023 23:37 — forked from julianlam/tp-link-ac600-ac1300-drivers-linux.md
Installing drivers for the TP-Link T2U/T3U Plus (AC600 or AC1300) Wireless Adapter #blog
@directentis1
directentis1 / list_of_network_tools.md
Last active August 3, 2023 16:56
some tools that I collect (albeit randomly) in the process of searching, reading, researching with the Internet.
@directentis1
directentis1 / insomnia_installer.sh
Created July 15, 2023 09:06
Download latest insomnia for linux from their repository
#!/bin/bash
wget "https://updates.insomnia.rest/downloads/ubuntu/latest?&app=com.insomnia.app&source=website" -O /tmp/insomnia.deb \
&& sudo apt install /tmp/insomnia.deb -qqy \
&& rm -f /tmp/insomnia.deb
@directentis1
directentis1 / networkminer_installer.sh
Created July 14, 2023 16:07
Download and configure network miner for Linux x86_64
#!/bin/bash
# Install necessary packages
sudo apt install mono-devel tcpdump netsniff-ng netcat socat -yqq
# Install NetworkMiner
wget https://www.netresec.com/?download=NetworkMiner -O /tmp/nm.zip
sudo unzip /tmp/nm.zip -d /home/ubuntu/apps
sudo rm -r /tmp/nm.zip
cd /home/ubuntu/apps/NetworkMiner*
@directentis1
directentis1 / httpie_installer.sh
Created July 12, 2023 12:58
This script use to install latest HTTPie from their github repository.
#!/bin/bash
httpie_latest_release_url=$(curl -s -H "Accept: application/vnd.github+json" https://api.github.com/repos/httpie/desktop/releases/latest | grep 'browser_' | cut -d\" -f4 | grep '.AppImage' | grep -v "arm64") && wget "$httpie_latest_release_url" -O httpie_latest.AppImage && chmod 755 httpie_latest.AppImage \
&& ./httpie_latest.AppImage --appimage-extract \
&& mv squashfs-root /home/ubuntu/apps/httpie \
&& rm -f httpie_latest.AppImage
@directentis1
directentis1 / nmap_debian_installer
Last active July 7, 2023 08:35
convert rpm packages from its website to debian format and install it using apt or apt-get
#!/usr/bin/bash
# Install conversion tool
sudo apt-get install alien -yqq --no-install-recommends
# Convert npm packages to debian packages
cd nmap_rpms
sudo alien *.rpm
# Installing them with apt/apt-get