Skip to content

Instantly share code, notes, and snippets.

View agostini01's full-sized avatar

Nicolas Agostini agostini01

View GitHub Profile
#!/bin/bash
blue='\e[0;34m'
NC='\e[0m' # No Color
# Utility functions
APT_GET="sudo apt-get -qq --assume-yes"
# Install Chrome
echo -e "${blue}### Installing Chrome${NC}"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
@agostini01
agostini01 / printBatteryInfo.sh
Created April 25, 2018 04:08
Print Battey Information in Linux
#!/bin/bash
upower -i /org/freedesktop/UPower/devices/battery_BAT0
@agostini01
agostini01 / setupDotfiles.sh
Created April 25, 2018 04:16
Setup dotfiles like tmux and vim
#!/bin/bash
pushd ~
git clone https://github.com/agostini01/dotfiles.git
ln -sf dotfiles/.gitignore_global .gitignore_global
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
ln -sf dotfiles/.vimrc .vimrc
ln -sf dotfiles/.ctags .ctags
@agostini01
agostini01 / perf-fp-counters
Last active August 8, 2019 20:37
How to get fp events and fp ops per second in skylake?
Followed this tutorial:
http://www.bnikolic.co.uk/blog/hpc-howto-measure-flops.html
Get the latest version of perfmon2/libpfm (h/t this developerworks article):
git clone git://perfmon2.git.sourceforge.net/gitroot/perfmon2/libpfm4
cd libpfm4
@agostini01
agostini01 / zedboard-connections.md
Last active September 18, 2019 19:35
We will go through the steps of communicating to a digilent Zedboard using the UART and the Ethernet port.

Connecting to the Zedboard

We will go through the steps of communicating to a digilent Zedboard using the UART and the Ethernet port.

This tutorial assumes that the zedboard SD card was flashed with the Xillinux distribution for Zynq-7000 EPP and the host system is running a ubuntu 14.04 or newer (tested on 16.04).

Using UART port

Connect the host (USB) to the zedboard's UART port (micro USB) and execute on the host:

@agostini01
agostini01 / deabloating-xiaomi-9t.md
Last active February 28, 2021 14:34
Debloating Xiaomi 9t pro with ADB

You can remove these apps (or re-install them if needed) using the XIAOMI ADB/Fastboot Tools.

https://github.com/Saki-EU/XiaomiADBFastbootTools

Alternatively it is possible to use the commandline:

pm uninstall -k --user 0 com.mi.android.globalpersonalassistant
pm uninstall -k --user 0 com.xiaomi.mipicks
pm uninstall -k --user 0 com.android.browser
#install ubuntu 18.04
apt update && apt dist-upgrade -y
apt install vim tmux htop git tree curl wget ctags linux-tools-common linux-tools-generic linux-tools-`uname -r` valgrind kcachegrind -y
# nvidia drivers
cd # changes to root's home folder
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
@agostini01
agostini01 / custom-op-tf2.md
Created December 3, 2019 16:26
Custom OP for tensorflow 2.0

I have been working on TF 2.0 and the custom op tutorial presented here does allow execution of the op.

This is mainly due to eager execution and different custom op handling.

In order to call a custom op in python one must:

Start docker image

docker pull tensorflow/tensorflow:nightly-custom-op-ubuntu16

Extracted with:

for var in synthesizer._model.model.all_vars:
    print('{:15} {} {}'.format(
        '{}'.format(var.get_shape().as_list()),
        var.dtype,
        var.name))
@agostini01
agostini01 / htop.strace
Created April 27, 2020 13:55
htop strace
241 execve("/usr/bin/htop", ["htop"], 0x7fffeaaf9b78 /* 24 vars */) = 0
241 brk(NULL) = 0x7fffd27d9000
241 arch_prctl(0x3001 /* ARCH_??? */, 0x7fffdaf59710) = -1 EINVAL (Invalid argument)
241 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
241 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
241 fstat(3, {st_mode=S_IFREG|0644, st_size=27438, ...}) = 0
241 mmap(NULL, 27438, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7facd63d6000
241 close(3) = 0
241 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
241 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\221\0\0\0\0\0\0"..., 832) = 832