Skip to content

Instantly share code, notes, and snippets.

View gaiar's full-sized avatar

Gaiar Baimuratov gaiar

View GitHub Profile
@gaiar
gaiar / rpi2-arch-linux-to-sdcard.sh
Created September 18, 2018 11:49 — forked from pklaus/rpi2-arch-linux-to-sdcard.sh
Raspberry Pi 2: Arch Linux ARM to SDcard Script. This is for the Rapsberry Pi 2. For the RPi 1, see https://gist.github.com/pklaus/b92dfc72136d1509c2ed
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2>
echo -e "\n\nArch Linux ARM to SD Card"
echo -e "for the Raspberry Pi 2"
echo -e "(and for the Raspberry Pi 3, if you don't need to use the unofficial arm64 variant)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@gaiar
gaiar / rpi-arch-linux-to-sdcard.sh
Created September 18, 2018 11:49 — forked from pklaus/rpi-arch-linux-to-sdcard.sh
for the Raspberry Pi 1, Zero, Zero W : Arch Linux ARM to SD Card Script; See https://gist.github.com/pklaus/9dd4a7bf040788cda501 for RPi 2
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv6/raspberry-pi>
echo -e "\n\nArch Linux ARM for Raspberry Pi to SD Card"
echo -e "(Not meant for the Raspberry Pi 2 - "
echo -e " check https://gist.github.com/pklaus/9dd4a7bf040788cda501 instead.)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@gaiar
gaiar / rpi3-arch-linux-to-sdcard.sh
Created September 18, 2018 11:49 — forked from pklaus/rpi3-arch-linux-to-sdcard.sh
Raspberry Pi 3: Arch Linux ARM 64bit to SDcard Script. This is for the Rapsberry Pi 3. For the RPi 2 (or the 3 32bit), see https://gist.github.com/pklaus/9dd4a7bf040788cda501 . For the RPi 1, see https://gist.github.com/pklaus/b92dfc72136d1509c2ed .
#!/bin/bash
# <https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3>
echo -e "\n\nArch Linux ARM to SD Card"
echo -e "For the Raspberry Pi 3, if you want to use the unofficial arm64 variant."
echo -e "(Otherwise use the Raspberry Pi 2 version of this script!)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@gaiar
gaiar / Xiaomi YI.md
Created August 4, 2018 12:48 — forked from franga2000/Xiaomi YI.md
Xiaomi Yi

#Xiaomi Yi camera

##General info

  • OS: Buildroot
  • CPU: ARMv6-compatible processor rev 5 (v6l)
  • BogoMIPS: 524.28
  • Memory: 37MB

The root filesystem is rootfs, which is stored in memory and therefore wiped on reboot. The Micro SD card is mounted at /tmp/fuse_d/. Something is also mounted at /tmp/fuse_a and /tmp/fuse_z.

@gaiar
gaiar / 01.README.md
Created July 23, 2018 14:07 — forked from matsukaz/01.README.md
Find a geolocation of an IP address in BigQuery

This query is to find geolocation of an IP address including latitude, longitude, city and country.

Legacy SQL doesn't support range conditions such as BETWEEN when using JOIN, so we need to filter data by WHERE. This means if IP address does not match any of the data inside geolite_city_bq_b2b, records will not be able to receive.

Use Standard SQL if you want to receive records no matter you succeed to find geolocation or not.

Please refer to the following post for more detail.

https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html

@gaiar
gaiar / Dockerfile
Created July 3, 2018 08:12 — forked from snakers4/Dockerfile
My PyTorch 0.4 Dockerfile
# add 7z tar and zip archivers
FROM nvidia/cuda:9.0-cudnn7-devel
# https://docs.docker.com/engine/examples/running_ssh_service/
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:Ubuntu@41' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
RUN mkdir ~/.ssh/
@gaiar
gaiar / DS NN guidelines
Created June 6, 2018 12:03 — forked from snakers4/DS NN guidelines
Complete system installation for Data Science / Neural Networks from scratch / bare metal (assuming you have assembled the PC)
# BASIC SYSTEM SETUP
# First donwload Ubuntu iso file from https://www.ubuntu.com/download/desktop
# Use 16.04 LTS (17 is also ok, but it's better to use LTS versions, also 18 will be very mature in terms of systemd)
# Dowload Linux live USB creator and install the iso to your USB stick https://www.linuxliveusb.com
# Boot your system, go to BIOS on boot (usually Del) or boot menu (usually F12) and choose your USB stick as boot medium
# Install Linux (these steps can be omitted if clean Ubuntu installation is provided as service by admins / cloud provider / etc)
# Minor trick unplug ALL of your hard disks (unless you are an avanced user) except for the disk for your system
@gaiar
gaiar / pytorch-on-raspberry-pi3.md
Created May 23, 2018 08:54 — forked from fgolemo/pytorch-on-raspberry-pi3.md
How to install PyTorch v0.3.1 on RaspberryPi 3B - Tutorial

How to install PyTorch v0.3.1 on RaspberryPi 3B

Prerequisites

Important I'd recommend you use at least a 16GB sd card. I tried it with an 8GB card and it baaaaarely fits. I had to uninstall a lot of packages and regularly clean up.

Go to https://www.raspberrypi.org/downloads/raspbian/ and download the Raspbian Stretch image (either one).

Use Etcher (from https://etcher.io/) to "burn" the image onto the SD card.

@gaiar
gaiar / travis_to_conda.md
Created May 14, 2018 12:16 — forked from zshaheen/travis_to_conda.md
How to Setup Automatic Uploads to Anaconda from Travis CI in 15 minutes

How to Setup Automatic Uploads to Anaconda from Travis CI in 15 minutes

TL;DR: Edit .travis.yaml to install Anaconda and to run conda_upload.sh after testing. Edit meta.yaml to take in the environmental variables $VERSION and $CONDA_BLD_PATH. Create conda_upload.sh which sets the needed environmental variables, builds the tar archive, and uploads it to Anaconda. Finally edit some stuff on your Anaconda and Travis CI account so they can talk.

Intro

The following steps will detail how to automatically trigger Anaconda builds and uploads from Travis CI. This will only upload successful builds in the master branch and if there are multiple commits in a single day, it'll only keep the latest one. Both of these settings can easily be changed.

Edit .travis.yaml

First, edit .travis.yml so that it installs Anaconda.

install:
@gaiar
gaiar / App Store
Created November 16, 2017 11:16 — forked from mattcassinelli/App Store
Action list to open the App Store, search for a term, and open the Top Paid, Free, or Grossing charts.
http://[[list:App Store|Open=appstore.com/|Search=search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=[prompt:Query]|Top Paid=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=30|Top Free=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=27|Top Grossing=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=38]]
http://
[[
list:App Store
|Open=appstore.com/
|Search=search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=[prompt:Query]
|Top Paid=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=30
|Top Free=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=27
|Top Grossing=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=38