Skip to content

Instantly share code, notes, and snippets.

View ericfourrier's full-sized avatar
🦉
Building neat tools to secure cloud and source code

Eric Fourrier ericfourrier

🦉
Building neat tools to secure cloud and source code
View GitHub Profile
#!/usr/bin/env bash
#The MIT License (MIT)
#Copyright (c) 2014 Oak Ridge National Laboratory
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
conda clean -t # will remove the old tarballs
conda clean -p # will remove outdated packages
# conda clean -tp # if you want both
# 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))
# Quick look to the size of mysql of all databases
ls -lah /var/lib/mysql
SELECT table_schema AS "database_name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
scp -c blowfish -C username@ip:path_remote path_client
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
#History of logins
cat /var/log/auth.log
# 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
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm