Skip to content

Instantly share code, notes, and snippets.

View nick-fullstack-dev's full-sized avatar

nick-fullstack-dev

View GitHub Profile
@nick-fullstack-dev
nick-fullstack-dev / Create_new_folder_for_each_file.md
Last active August 17, 2021 22:34
Create new folder for each file - Linux/MacOs

Create a folder based on the filename, but exclude the extension, then move the original item with the same name into the folder.

before:

Folder
|- File1.ext
|- File2.ext
|- File3.ext
|- File4.ext
@nick-fullstack-dev
nick-fullstack-dev / goaccess.service
Created June 16, 2020 14:07 — forked from virtualdreams/goaccess.service
goaccess systemd service
[Unit]
Description=Goaccess Web log report.
After=network.target
[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStart=/usr/local/bin/goaccess -a -g -f /var/log/nginx/access.log -o /srv/www/goaccess/index.html --real-time-html --ws-url <your url>
After a reboot, i can no longer connect to my Debian 10 server in SSH.
I receive the following error message: Socket is closed: Socket closed by remote peer
The identifier/password are correct (i don't use a key), I tried with Putty, ZenTermLite and Filezilla clients in sFTP mode.
# log filezilla
Status: Connecting to xx.xx.xx.xx...
Response: fzSftp started, protocol_version=9
Command: open "root@xx.xx.xx.xx" 22
@nick-fullstack-dev
nick-fullstack-dev / gist:7bb60e0fb863de6151879e3f3f071336
Created June 10, 2020 16:39
Working with Email Addresses in SQL
/// QUERY - Checking if an email address if valid ///
SELECT email,
email REGEXP '^[A-Za-z0-9._%\-+!#$&/=?^|~]+@[A-Za-z0-9.-]+[.][A-Za-z]+$' AS valid_email
FROM email_table
/// RESULT ///
email | valid_email
@nick-fullstack-dev
nick-fullstack-dev / agent.sh
Created June 8, 2020 19:16 — forked from tokyoneon/agent.sh
MyCC - turn MyBB forums into C&C servers
#!/bin/bash
# https://null-byte.com/turn-forums-into-c-c-servers-0196708/
while true; do
forumUser="tokyoneon";
username="tokyoneon@email.com";
password="treHGFd76547^%$";
cookies='/tmp/forum_cookies';
function urlencode ()
@nick-fullstack-dev
nick-fullstack-dev / starUML.md
Created June 2, 2020 14:58 — forked from trandaison/starUML.md
Get full version of StarUML
@nick-fullstack-dev
nick-fullstack-dev / Protonmail.md
Last active February 20, 2026 03:54 — forked from ibaiul/Protonmail.md
Configure the protonmail bridge linux client on Ubuntu 20.04 and Debian 10 server

Protonmail on Ubuntu 20.04 and Debian 10 server

#protonmail #debian #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

@nick-fullstack-dev
nick-fullstack-dev / gist:db6ea52f45bd9b2205e600488bb964bc
Last active February 19, 2020 02:41
Command grep for extracting email addresses from big text files. You can pass it multiple files. Tested on large 190GB file (with 152,353,216 lines)
# split the file into a file of 50,000 lines.
split -b 50000 bigfile.txt
# OR split the file into a 100MB file.
split -b 100M bigfile.txt
# extract the email addresses contained in all the files of a directory
grep -r -E -h -o "[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*" /dir/* > emails.txt
# remove duplicates and sort order ASC
@nick-fullstack-dev
nick-fullstack-dev / README.TXT
Last active November 26, 2019 09:04
install Nginx 1.16, SSL Let's Encrypt for wildcard, PHP7.3 FPM 7.3.11, MySQL 8, PHPmyadmin 4.6, Postfix 3.4 on Ubuntu 19.10 x64 (Eoan Ermine)
install Nginx, SSL Let's Encrypt, PHP7.3, MySQL, PHPmyadmin, Postfix on Ubuntu 19.10 x64 (Eoan Ermine)
package version :
- nginx-extras 1.16.1
- php7.3 fpm 7.3.11
- mysql 8.0.18
- phpmyadmin 4.6.6-5
- postfix 3.4.5-1
- certbot
@nick-fullstack-dev
nick-fullstack-dev / generate.php
Created April 19, 2016 21:27
PHP: CLI script that can also be run in a web browser
<?php
// I had a command line (CLI) script written in PHP that I wanted to be able to
// run via the web, to save having to open a terminal and SSH connection each
// time.
// First I had to modify the console script so it could output messages to
// either the console, using STDOUT or STDERR, or the web, which requires
// flushing the buffer each time: