nmap 192.168.1.0/24
: This scans the entire class C rangenmap -p <port ranges>
: This scans specific portsnmap -sP 192.168.1.0/24
: This scans the network/find servers and devices that are runningsudo nmap -sP 192.168.1.0/24
: Using sudo can be necessary on mac to get the MAC Adressnmap -O 192.168.1.1-42
: Scan from port 1 to 42nmap -O 192.168.1.150
:# Os detection with target ipnmap –iflist
: This shows host interfaces and routesnmap –sV 192.168.1.1
: This detects remote services' version numbersnmap –sS 192.168.1.1
: This performs a stealthy TCP SYN scannmap –sO 192.168.1.1
: This scans for the IP protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /tmp | |
wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160210_all.deb | |
apt-get install libnewt0.52 whiptail parted triggerhappy lua5.1 alsa_utils | |
dpkg -i raspi-config_20160210_all.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scan all ports | |
nmap -sP 192.168.1.0/24 | |
# scan all ports and try to detect mac address | |
sudo nmap -sP 192.168.1.0/24 | |
# scan list of posts | |
nmap -O 192.168.1.1-42 # scan from 1 to 42 | |
# Os detection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#History of logins | |
cat /var/log/auth.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df_season=df.groupby(df.date.dt.month)[colname].sum() | |
df_season=df.groupby(df.date.dt.dayofweek)[colname].sum() | |
df_season=df.groupby(df.date.dt.quarter)[colname].sum() | |
#etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scp -c blowfish -C username@ip:path_remote path_client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema AS "database_name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick look to the size of mysql of all databases | |
ls -lah /var/lib/mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load library ------------------------------------------------------------ | |
library(dplyr) | |
# Basic functions to explore NA in Dataframe -------------------------------------------------------------- | |
# Identify all missing variables per columns | |
countNaCol <- function(data) { | |
result <- vapply(data,function(x) sum(is.na(x)),integer(1)) | |
result <- data.frame(Nbna = result, napercentage = round(result/nrow(data),3)) |