Skip to content

Instantly share code, notes, and snippets.

View gaiar's full-sized avatar

Gaiar Baimuratov gaiar

View GitHub Profile
@gaiar
gaiar / download_images.py
Created May 2, 2019 09:58
Download images for dataset using CSV as an input #birds-of-berlin
import requests
import re
from google_images_download import google_images_download
import random
import csv
import os
import sys
import logging
@gaiar
gaiar / install_google_images_download.sh
Last active May 1, 2019 10:17
Installing Python library for downloading images
#!/usr/bin/env bash
conda activate birds
git clone https://github.com/hardikvasa/google-images-download.git
cd google-images-download && sudo python setup.py install
@gaiar
gaiar / berlin-birds-enriched.csv
Created May 1, 2019 09:43
Enriched list of Berlin birds
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 6 columns, instead of 4 in line 6.
Name,Alternative name,Russian name,WikipediaDE,Latin name,Image URL
Amsel,Schwarzdrossel,Чёрный дрозд,https://de.wikipedia.org/wiki/Amsel,Turdus merula,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-amsel_seehawer.jpg
Bachstelze,,Белая трясогузка,https://de.wikipedia.org/wiki/Bachstelze,Motacilla alba,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-seehawer_bachstelze.jpg
Bartmeise,,Усатая синица,https://de.wikipedia.org/wiki/Bartmeise,Panurus biarmicus,
Baumfalke,,Чеглок,https://de.wikipedia.org/wiki/Baumfalke,Falco subbuteo,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-baumfalke_falco_subbuteo_tatiana_bulyonkova.jpg
Bergfink,,Вьюрок,https://de.wikipedia.org/wiki/Bergfink,Fringilla montifringilla,
Birkenzeisig,,Чечётка,https://de.wikipedia.org/wiki/Birken
@gaiar
gaiar / berlin-birds.csv
Last active May 1, 2019 09:42
Parsed list of Berlin Birds
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 3 columns, instead of 2 in line 6.
Name,Latin name,Image URL
Amsel Schwarzdrossel, Turdus merula,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-amsel_seehawer.jpg
Bachstelze, Motacilla alba,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-seehawer_bachstelze.jpg
Baumfalke, Falco subbuteo,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-baumfalke_falco_subbuteo_tatiana_bulyonkova.jpg
Birkenzeisig, Carduelis flammea,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-birkenzeisig_juha_soininen_984434.jpg
Blässhuhn, Fulica atra,https://www.berlin.de/ba-charlottenburg-wilmersdorf/verwaltung/aemter/umwelt-und-naturschutzamt/naturschutz/pflanzen-artenschutz/mdb-blesshuhn_philip_mackenzie_717748.jpg
Blaumeise, Cyanistes c
@gaiar
gaiar / get_list_of_berlin_birds.py
Created April 27, 2019 11:15
Pulling the list of all birds inhabiting Berlin from berlin.de website
from bs4 import BeautifulSoup
import requests
import csv
import random
# Using random user-agent to emulate regular browser
user_agent_list = [
#Chrome
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',
'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36',
@gaiar
gaiar / install_web_scraping_pkgs.sh
Created April 27, 2019 11:06
Installing Beautiful Soap and Requests
#!/usr/bin/env bash
conda activate berlin-birds
conda install -c conda-forge requests beautifulsoup4 -y
@gaiar
gaiar / create_env.sh
Last active April 27, 2019 10:55
Create conda environment
#!/usr/bin/env bash
conda create -n berlin-birds python=3.6 -y
conda activate berlin-birds
which python
@gaiar
gaiar / install_conda.sh
Created April 27, 2019 10:45
Installing Python packages for Web Scrapping
#!/usr/bin/env bash
sudo apt update
sudo apt install wget -y
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
eval "$(~/miniconda/bin/conda shell.bash hook)"
conda init
@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