Skip to content

Instantly share code, notes, and snippets.

View nuriel77's full-sized avatar

Nuriel Shem-Tov nuriel77

View GitHub Profile
@nuriel77
nuriel77 / metal-node-names.py
Created March 31, 2017 14:00
Get ironic - nova server name relations
#!/usr/bin/env python
from keystoneauth1 import identity
from keystoneauth1 import session
from ironicclient import client as ironic_client
from novaclient import client as nova_client
from os import environ
import getopt
import sys
@nuriel77
nuriel77 / hs_err_pid14815.log
Created September 12, 2017 06:17
iri 1.3.2.1
#
# 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 / check_node.sh
Created January 15, 2018 18:36
IOTA Full Node Check script
#!/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 / gist:8758f2f6722968d20a6f81f75daecbbf
Created January 22, 2018 08:29
Install oracle java manually on ubuntu/debian
# 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 / block_tor
Last active January 23, 2018 20:30
How to block tor network, set in cron to repeat every 6 hours, set for reboot
# 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 / watch_events.py
Last active March 5, 2018 22:50
Watch for events from kubernetes
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
@nuriel77
nuriel77 / gist:fc02d1a8da8289e7d96c436b2443b09f
Last active March 17, 2018 00:29
example install apach2 php7.0
### 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
# Create a file with:
export DIB_DHCP_TIMEOUT=75
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
export DIB_YUM_REPO_CONF="$DIB_YUM_REPO_CONF /etc/yum.repos.d/CentOS-Ceph-Jewel.repo"
export STABLE_RELEASE="newton"
openstack overcloud image build --all
# Run above file (in screen)
# Then:
@nuriel77
nuriel77 / default
Created May 24, 2018 21:01
nginx-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 / undercloud-playbook.yaml
Last active August 21, 2018 14:56
Ansible playbook to initialize new undercloud for tripleo
#
# Ansible playbook to prepare the undercloud machine.
# Will preform all steps until custom steps are to be taken --
# which are: providing a custom undercloud.conf and running
# openstack install undercloud command and so on...
# Root SSH access to the remote machine has to be configured.
# Edit vars as necessary.
#
# If this is the first time you are using Ansible on a host,