Skip to content

Instantly share code, notes, and snippets.

View gaiar's full-sized avatar

Gaiar Baimuratov gaiar

View GitHub Profile
@gaiar
gaiar / pycon-views.py
Last active August 26, 2015 11:37 — forked from miguelgrinberg/pycon-views.py
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@gaiar
gaiar / main.py
Last active September 9, 2015 07:14 — forked from leandrotoledo/main.py
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
@gaiar
gaiar / python3_mraa_upm
Last active January 16, 2023 16:21
How to install Python 3 with libmraa and upm
GETTING FROM REPO
# Adding repositories and installing required software
echo "src/gz all http://repo.opkg.net/edison/repo/all" >> /etc/opkg/base-feeds.conf && echo "src/gz edison http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf && echo "src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32" >> /etc/opkg/base-feeds.conf && opkg update
# Updating mraa and upm
opkg upgrade libmraa0 && opkg upgrade upm
@gaiar
gaiar / tmux-cheatsheet.markdown
Created June 26, 2017 06:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
/**
* @param $app
* @return int:
* -4: Error
* -3: Googlebot
* -2: Found locally, not a VPN
* -1: Looked up, not a VPN
* 1: Looked up, VPN
* 2: Found locally, VPN
*/
@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
sudo apt-get install libtool-bin
mkdir ~/developer/ffmpeg
mkdir ~/developer/ffmpeg/arm
cd ~/developer/ffmpeg
wget http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-2.0.2.tar.gz
tar -xzf libaacplus-2.0.2.tar.gz
cd libaacplus-2.0.2
#./autogen.sh --with-parameter-expansion-string-replace-capable-shell=/bin/bash --enable-static --host=arm-unknown-linux-gnueabi --prefix=~/developer/ffmpeg/arm
./autogen.sh --with-parameter-expansion-string-replace-capable-shell=/bin/bash --enable-static --prefix=~/developer/ffmpeg/arm
@gaiar
gaiar / rasp_temp.py
Last active June 4, 2018 12:42
RaspPI temp
#!/usr/bin/env python
import plotly.plotly as py # plotly library
from plotly.graph_objs import * # all plotly graph objects
import json # used to parse config.json
import time # timer functions
import datetime
import os # used to acquire internal SoC temperature
import sys
sudo apt-get install mercurial && \
cd ~/ffmpeg_sources && \
if cd x265 2> /dev/null; then hg pull && hg update; else hg clone https://bitbucket.org/multicoreware/x265; fi && \
cd x265/build/linux && \
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source && \
PATH="$HOME/bin:$PATH" make -j4 && \
make install
cd ~/ffmpeg_sources && \
git -C libvpx pull 2> /dev/null || git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
@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: