Skip to content

Instantly share code, notes, and snippets.

@haryx8
haryx8 / countLine.sh
Created May 29, 2020 00:15
It will give an accurate source lines of code count for whatever hierarchy you point it at, as well as some additional stats.
#!/bin/bash
find $1 -name '*.php' | xargs wc -l
#find $1 -name '*.php' | xargs wc -l | sort -nr
#!/bin/bash
read -p 'Desired file name (eg. *safe*, *.bak): ' name
sudo find / -name "$name"
#sudo find / -name ".DS_Store" -exec rm {} \;
#!/bin/bash
PIN1=`openssl x509 -pubkey < primary.crt | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64`
PIN2=`openssl x509 -pubkey < backup.crt | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64`
echo
echo ==================================
echo == Public_Key_Pinning generator ==
echo ==================================
echo
echo -e "\033[5m\033[1m\033[31mapache:\033[0m"
echo Header always set Public-Key-Pins "pin-sha256=\"$PIN1\"; pin-sha256=\"$PIN2\"; max-age=5184000; includeSubDomains"
@haryx8
haryx8 / nmap_scanning.sh
Last active February 20, 2019 01:57
nmap_scanning.sh
nmap -Pn --script vuln fqdn
nmap --script ssl-cert,ssl-enum-ciphers -p 443 fqdn
nmap --script "mysql-*" fqdn
nmap --script "http-*" fqdn
nmap -Pn --script vuln fqdn
@haryx8
haryx8 / restore_mysql_from_bz2.sh
Created February 8, 2018 10:27
Restore MySQL from bz2 file
#!/bin/bash
bunzip2 < db_filename.sql.bz2 | mysql -u root -p target_db_name
#!/bin/bash
black=`tput setaf 0`
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
magenta=`tput setaf 5`
cyan=`tput setaf 6`
white=`tput setaf 7`
reset=`tput sgr0`
@haryx8
haryx8 / lfs
Created February 14, 2017 07:04
@@@@@@@
@ LFS @
@@@@@@@
apt-get install gawk
apt-get install bison
apt-get install texinfo
# create boot partition 100MB ext2
# create system partition 9900MB ext4
db.authors.insert([
{
_id: 'a1',
name: { first: 'orlando', last: 'becerra' },
age: 27
},
{
_id: 'a2',
name: { first: 'mayra', last: 'sanchez' },
age: 21
package main
import (
"encoding/json"
"fmt"
"log"
)
type Envelope struct {
Type string
# mkisofs on linux:
mkisofs -T -r -o filename.iso pathname/
# mkisofs on windows:
mkisofs -v -dvd-video -V "VOLUME_NAME" -o "c:\my movies\iso\movie.iso" "c:\my movies\dvd"
mkisofs -r -R -J -l -L -o image-file.iso c:\project\install