Skip to content

Instantly share code, notes, and snippets.

View gaiar's full-sized avatar

Gaiar Baimuratov gaiar

View GitHub Profile
@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 / dosbox.patch
Created August 3, 2018 10:10
dosbox-sdl2 patch
Index: acinclude.m4
===================================================================
--- acinclude.m4 (revision 4132)
+++ acinclude.m4 (working copy)
@@ -1,164 +1,147 @@
-dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
-dnl
-AC_DEFUN([AM_PATH_SDL],
-[dnl
curl -s https://api.github.com/repos/atom/atom/releases | grep browser_download_url | grep '64[.]deb' | head -n 1 | cut -d '"' -f 4
@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

conda inspect hash-inputs <package path>
ctng_nature:
- shared
ctng_sample:
- x86_64-centos6-linux-gnu
ctng_cpu_arch:
- x86_64
ctng_libc:
- gnu
gnu:
- 2.12.2
@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/
git reflog expire --all --expire=now
git gc --prune=now --aggressive
wget http://nginx.org/download/nginx-1.9.11.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.7.tar.gz
tar xzf nginx-1.9.11.tar.gz
tar xzf v1.1.7.tar.gz
pacman -Sy base-devel ffmpeg nginx
cd nginx-1.9.11
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/bin/nginx \