Skip to content

Instantly share code, notes, and snippets.

View andrewssobral's full-sized avatar
🔴
I may be very slow to respond.

Andrews Cordolino Sobral andrewssobral

🔴
I may be very slow to respond.
View GitHub Profile
@andrewssobral
andrewssobral / ssecheck.cpp
Created May 27, 2020 20:05 — forked from hi2p-perim/ssecheck.cpp
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
grep avx /proc/cpuinfo
g++ ssecheck.cpp -o ssecheck
*/
#include <iostream>
#ifdef _MSC_VER
@andrewssobral
andrewssobral / pytorch_gpu_test.py
Created July 23, 2019 14:57
pytorch_gpu_test.py
import torch
print(torch.cuda.current_device())
# 0
print(torch.cuda.device(0))
# <torch.cuda.device at 0x...>
print(torch.cuda.device_count())
# 1
@andrewssobral
andrewssobral / tensorflow_test.py
Last active March 13, 2021 16:54 — forked from seominjoon/tf_test.py
tensorflow_test
import tensorflow as tf
import numpy as np
import time
from tensorflow.contrib.rnn import BasicLSTMCell
# https://github.com/tensorflow/tensorflow/issues/24828
try:
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
@andrewssobral
andrewssobral / tensorflow_keras_cifar10.py
Last active March 13, 2021 16:54
tensorflow_keras_cifar10
import os, json, shutil
import keras
from keras.callbacks import TensorBoard
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
@andrewssobral
andrewssobral / list_wifi_pass_win.bat
Created April 14, 2019 20:11
list_wifi_pass_win.bat
netsh wlan show profiles
netsh wlan show profile name=profilename key=clear
@andrewssobral
andrewssobral / rpi-qemu.sh
Last active April 9, 2019 16:40
rpi-qemu.sh
#!/bin/sh
# MacOS Mojave
brew install qemu
export QEMU=$(which qemu-system-arm)
export TMP_DIR=~/tmp/qemu-rpi
export RPI_KERNEL=${TMP_DIR}/kernel-qemu-4.14.79-stretch
export RPI_FS=${TMP_DIR}/2018-11-13-raspbian-stretch-lite.img
@andrewssobral
andrewssobral / restart_bluetooth.sh
Created January 28, 2019 09:48 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
git clone https://github.com/pytorch/pytorch.git
git submodule update --init --recursive
MACOSX_DEPLOYMENT_TARGET=10.14 CC=clang CXX=clang++ python setup.py install
@andrewssobral
andrewssobral / pytorch-mnist.cpp
Created October 27, 2018 20:18
PyTorch MNIST C++
// https://github.com/goldsborough/examples/blob/cpp/cpp/mnist/mnist.cpp
#include <torch/torch.h>
#include <cstddef>
#include <iostream>
#include <string>
#include <vector>
struct Net : torch::nn::Module {
Net()
@andrewssobral
andrewssobral / demo_depth2color.py
Created October 21, 2018 17:59
demo_depth2color.py (Intel® RealSense™ SDK)
## License: Apache 2.0. See LICENSE file in root directory.
## Copyright(c) 2017 Intel Corporation. All Rights Reserved.
#####################################################
## Align Depth to Color ##
#####################################################
# First import the library
import pyrealsense2 as rs
import numpy as np