Skip to content

Instantly share code, notes, and snippets.

View limushi's full-sized avatar

Maxim Lianov limushi

View GitHub Profile
@limushi
limushi / curl-crawler.sh
Created January 11, 2019 14:47 — forked from oliveratgithub/curl-crawler.sh
Unix Shell-Script to crawl a list of website URLs using curl
#!/bin/sh
timezone="Europe/Zurich"
# List of valid timezones: wikipedia.org/wiki/List_of_tz_database_time_zones
script="${0##*/}"
rootdir=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
logfile="$script.log"
log="$rootdir/$logfile"
now=$(TZ=":$timezone" date)
# Uncomment 'mailto=' (remove #) to enable emailing the log upon completion
#mailto="your@email.com"
import requests
import pandas as pd
number_of_pages = 100
#number_of_ads = number_of_pages * per_page
job_title = ["'Data Analyst' and 'data scientist'"]
for job in job_title:
@limushi
limushi / curl.md
Created December 12, 2019 19:01 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@limushi
limushi / beowulf-cluster.md
Created July 9, 2022 13:04 — forked from arifsisman/beowulf-cluster.md
Beowulf Cluster Setup

Beowulf Cluster Setup

1. Introduction

A Beowulf cluster is a computer cluster of similar computers networked into a small local area network with libraries and programs installed which allow processing to be shared among them. The result is a high-performance parallel computing cluster from the inexpensive personal computer hardware.

This project aims to create a Beowulf Cluster which computes bigram analysis on a news data set. 2 virtual worker nodes and 1 virtual master node used for the cluster, all operating with Ubuntu Server 16.04.

@limushi
limushi / snat_dnat_advantech.md
Created February 14, 2023 19:25 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@limushi
limushi / README.md
Created March 29, 2023 22:07 — forked from mattupstate/README.md
An example of how to setup streaming replication for PostgreSQL with Docker.

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave:

@limushi
limushi / git.txt
Created May 24, 2023 10:27 — forked from AnatoliyNBulyga/git.txt
GIT list (шпаргалка по git-github)
Инициализировать новый репозиторий:
1
git init rep-name
Клонировать репозиторий с удаленного сервера:
1
git clone git@bitbucket.org:afiskon/hs-textgen.git
Добавить в репозиторий файл:
1
git add file.txt
Удалить файл из репозитория:
@limushi
limushi / remove-all-from-docker.sh
Created June 28, 2023 10:48 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@limushi
limushi / alert.sh
Created January 27, 2024 17:07 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",