Skip to content

Instantly share code, notes, and snippets.

View mlsmrc's full-sized avatar
🇮🇹
from Italy with love

Marco mlsmrc

🇮🇹
from Italy with love
  • Rome, Italy
View GitHub Profile
@mlsmrc
mlsmrc / cka_bookmarks.html
Last active January 4, 2021 09:15
Bookmarks for the Kubernetes Developer and Administrator certification
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1597756561" LAST_MODIFIED="1608916227" PERSONAL_TOOLBAR_FOLDER="true">Barra dei Preferiti</H3>
<DL><p>
@mlsmrc
mlsmrc / .vimrc
Created September 2, 2020 09:52
Handle tab as double space into vimrc file
# Extended version for your laptop
# store this file as ~/.vimrc
set nu
set expandtab
set shiftwidth=2
set tabstop=2
@mlsmrc
mlsmrc / kubectlrc
Last active January 2, 2021 22:35
Aliases for Kubernetes control cli kubectl - Specific for CKAD certification
alias k='kubectl'
alias kg='k get'
alias kgp='kg pod'
alias kd='k describe'
alias kdp='kd pod'
alias kD='k delete --force --grace-period=0'
alias kDp='kD pod'
alias kc='k create'
@mlsmrc
mlsmrc / hidePointer.sh
Created September 8, 2019 10:38
Hide Raspberry PI Mouse cursor
#!/bin/bash
# https://jackbarber.co.uk/blog/2017-02-16-hide-raspberry-pi-mouse-cursor-in-raspbian-kiosk
sudo apt-get -y install unclutter
echo "@unclutter -idle 0" >> ~/.config/lxsession/LXDE-pi/autostart
reboot
@mlsmrc
mlsmrc / RPiDocker.sh
Last active September 6, 2019 15:04
Install Docker on Raspberry PI
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker pi
sudo chmod 777 /var/run/docker.sock
# Install Docker Compose
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && sudo python3 get-pip.py
sudo pip3 install docker-compose
@mlsmrc
mlsmrc / configure_mac_pf.sh
Last active October 10, 2018 20:52
Blocking some incoming connections to specific ports for  Apple MacOS
# Move this files first
# pf.conf -> /etc/pf.conf
# security.pf.plist -> /Library/LaunchDaemons/security.pf.plist
# security.pflog0creation.plist -> /Library/LaunchDaemons/security.pflog0creation.plist
# security.pflog0dump.plist -> /Library/LaunchDaemons/security.pflog0dump.plist
#
chmod 644 /etc/pf.conf
sudo launchctl load -w /Library/LaunchDaemons/security.pf.plist
sudo launchctl load -w /Library/LaunchDaemons/security.pflog0creation.plist
sudo launchctl load -w /Library/LaunchDaemons/security.pflog0dump.plist
@mlsmrc
mlsmrc / macTag.sh
Last active June 11, 2022 07:57
Assign tags on MacOS using a cronjob
#!/bin/bash
EXTENSION_TAG_MAPPING="${HOME}/.tag_mapping"
CRONTAG_LOG="/var/log/crontag.log"
function __echo() { echo "$(date +%D:%H:%M.%S) - $@" | tee -a "${CRONTAG_LOG}"; }
which tag &>/dev/null || { __echo "main: missing tag. install it by using 'brew install tag'. Exiting.."; exit 1; }
ls "${EXTENSION_TAG_MAPPING}" &>/dev/null || { __echo "main: missing extension tag mapping file ($EXTENSION_TAG_MAPPING)'. Exiting.."; exit 1; }
@mlsmrc
mlsmrc / square_root.java
Last active September 2, 2020 09:42
Erone method to build the square root of a given number
import javax.swing.JOptionPane;
public class SquareRoot {
private int attempts=0;
private double x=0,epsilon = 0;
public SquareRoot(int x,double epsilon,int attempts)
{
this.x=(double)x;
@mlsmrc
mlsmrc / install.sh
Last active September 6, 2019 15:11
Install drivers Elegoo 3.5 LCD
#!/bin/bash
sudo apt-mark hold raspberrypi-bootloader
sudo apt-get -y upgrade
git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show
@mlsmrc
mlsmrc / dht11.ino
Created October 20, 2017 08:24
Simple file to check if your DHT11 works well into Arduino/Wemos D1 mini
#include <dht11.h>
#define DHT11_PIN D2
dht11 dht;
void setup() {
Serial.begin(115200);
}