Skip to content

Instantly share code, notes, and snippets.

@amiad
amiad / check.py
Last active December 7, 2022 12:08
Check relations of paths in OSM
#!/usr/bin/python
from shapely import geometry, ops
import overpy, smtplib, sqlite3, os
from datetime import date
trails = {
'שביל הגולן': 568661,
# 'גב חולית': 4084669,
'שביל ישראל': 282071,
@amiad
amiad / wordpress-update-version-plugins.sh
Created August 17, 2020 21:15
Update Wordpress version in readme of all plugins
#!/bin/bash
if [ -z "$1" ]; then
echo "version missed!"
exit 0
fi
plugins="ligery wordpress-hebrew-date en-spam"
plugindir="/home/plugins"
@amiad
amiad / convertRtg.js
Last active January 13, 2020 12:56
Convert odata nature reverses file to OSM format
const file = "resgan_2020-01-heb.osm";
const newFile = 'new_' + file;
let fs = require("fs");
let xml2js = require("xml2js");
let parseString = require("xml2js").parseString;
let deletedWaysId = [], orphanNodes = [];
fs.readFile(file, "utf-8", (err, data) => {
if (err) throw err;
@amiad
amiad / PKGBUILD
Last active May 16, 2018 13:04
culmus-0.132-1.5
# Maintainer: Ivan Puntiy <ivan.puntiy at gmail>
# Contributor: <francois.archlinux.org>
pkgname=culmus
pkgver=0.132
pkgrel=1.5
pkgdesc="A collection of Type1 and TrueType Hebrew fonts"
arch=('any')
url="http://culmus.sourceforge.net"
license=('GPL2')
@amiad
amiad / nginx_add_domain.sh
Last active June 4, 2019 13:13
Adding domain to nginx include https
#!/bin/bash
# Usage: ./nginx_add_domain.sh <domain> <webroot_directory> [<configuration_file>]
add_server(){
if [ ! -z $3 ]; then
echo "$4" >> "$3"
else
echo "add this block to nginx configuration file in http block"
echo ""
echo "$4"
@amiad
amiad / iptables.sh
Last active November 28, 2017 09:25 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, all connection on port 80 and 443, incoming connections on SSH port, outgoing SMTP port, and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER=$(egrep -v '^#' /etc/resolv.conf | cut -f2 -d' ')
# SSH Port
@amiad
amiad / PKGBUILD
Created September 5, 2017 13:18
jaxx-1.2.29 PKGBUILD
# Contributor: Hugo Ideler <hugo at hugoideler dot com>
pkgname=jaxx
pkgver=1.2.29
pkgrel=1
epoch=
pkgdesc="Multi-chain cryptocurrency wallet"
arch=('x86_64')
# ^ not tested on other platforms
url="https://jaxx.io/"
license=('unknown')
@amiad
amiad / -
Created November 23, 2016 12:37
#!/bin/bash
gksudo systemctl start teamviewerd
teamviewer
gksudo systemctl stop teamviewerd
@amiad
amiad / filter_emails.sh
Created September 20, 2016 08:28
Filter emails list from file
#!/bin/bash
cat $1 | egrep -o "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}" | tr '\n' ','
@amiad
amiad / import-to-aur4.sh
Last active November 5, 2019 21:56
moved to: https://github.com/amiad/aur2aur4 | Import packages from aur3 to aur4 by packages list or aur user
#!/bin/bash
function help_script(){
echo 'argument is missed'
echo 'Usage:'
echo './import-to.aur4.sh -l "pack1 pack2 pack3"'
echo 'or'
echo './import-to.aur4.sh -u username'
exit
}