Skip to content

Instantly share code, notes, and snippets.

Nuriel Shem-Tov nuriel77

Block or report user

Report or block nuriel77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nuriel77
nuriel77 / Dockerfile
Created Jan 11, 2020
Can be used for any arch based on --build-args
View Dockerfile
FROM alpine:latest
WORKDIR /app
LABEL org.label-schema.description="HORNET - The IOTA community node"
LABEL org.label-schema.name="gohornet/hornet"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.vcs-url="https://github.com/gohornet/hornet"
LABEL org.label-schema.usage="https://github.com/gohornet/hornet/blob/master/DOCKER.md"
ARG ARCH=x86_64
View gist:3fd23831895ffad460e878ca4ec5a63a
# Build image
FROM node:10-alpine AS build
RUN apk --no-cache add --update \
g++ \
gcc \
libgcc \
libstdc++ \
make \
python && \
npm install --quiet node-gyp -g
@nuriel77
nuriel77 / default
Created May 24, 2018
nginx-default
View default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@nuriel77
nuriel77 / gist:fc02d1a8da8289e7d96c436b2443b09f
Last active Mar 17, 2018
example install apach2 php7.0
View gist:fc02d1a8da8289e7d96c436b2443b09f
### INSTALL COMMAND:
root@test001:/home/ubuntu# apt-get -y install apache2 php7.0 libapache2-mod-php7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgd3 libjbig0 libtiff5 libvpx3 libxslt1.1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apache2-bin apache2-data libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 php-common php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline
@nuriel77
nuriel77 / block_tor
Last active Jan 23, 2018
How to block tor network, set in cron to repeat every 6 hours, set for reboot
View block_tor
# Ubuntu install wget
apt-get install wget -y
# CentOS install wget
yum install -y wget
# Get the script
wget https://raw.githubusercontent.com/nuriel77/iri-playbook/master/roles/iri/files/block_tor.sh -O /usr/local/bin/block_tor.sh && chmod +x /usr/local/bin/block_tor.sh
# Run the script for the first time
@nuriel77
nuriel77 / gist:8758f2f6722968d20a6f81f75daecbbf
Created Jan 22, 2018
Install oracle java manually on ubuntu/debian
View gist:8758f2f6722968d20a6f81f75daecbbf
# Run curl to get the oracle package:
curl -H 'Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie' -LO http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz
# mkdir in /opt and untar it
mkdir -p /opt/jdk && tar -zxvf jdk-8u162-linux-x64.tar.gz -C /opt/jdk/
# Link executables:
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_162/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_162/bin/javac 100
@nuriel77
nuriel77 / check_node.sh
Created Jan 15, 2018
IOTA Full Node Check script
View check_node.sh
#!/bin/bash
function usage(){
cat <<EOF
This script will run curl commands to the API endpoint.
If any of the tests fails this script will return failure.
-a [address] API endpoint
-t [seconds] Seconds until connection timeout
@nuriel77
nuriel77 / watch_events.py
Last active Mar 5, 2018
Watch for events from kubernetes
View watch_events.py
from kubernetes import client, config, watch
from pprint import pprint, pformat
import argparse
import logging
import urllib3
import threading
import signal
import time
import json
import sys
View hs_err_pid14815.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f55ac6dd112, pid=14815, tid=0x00007f55ac3b0700
#
# JRE version: OpenJDK Runtime Environment (8.0_141-b16) (build 1.8.0_141-b16)
# Java VM: OpenJDK 64-Bit Server VM (25.141-b16 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [librocksdbjni6170663081901826394.so+0x22b112] rocksdb::DBImpl::NewIterator(rocksdb::ReadOptions const&, rocksdb::ColumnFamilyHandle*)+0x92
#
@nuriel77
nuriel77 / doDomainSnapshot.py
Created Apr 23, 2017
Do libvirt snapshot for domain and define how many recent snapshots to keep
View doDomainSnapshot.py
#!/usr/bin/env python
import argparse
import libvirt
import logging
import time
import sys
import os
from pprint import pformat
from heapq import nlargest
You can’t perform that action at this time.