Skip to content

Instantly share code, notes, and snippets.

View AndreiD's full-sized avatar
🦄
🐦

Dan Ξ AndreiD

🦄
🐦
  • in front of a screen
View GitHub Profile
@AndreiD
AndreiD / test sockets
Created April 8, 2016 13:20
test android sockets
package com.androidadvance.testsockets;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.neovisionaries.ws.client.OpeningHandshakeException;
@AndreiD
AndreiD / firebase_to_elastic_search_helper
Created August 23, 2016 16:54
firebase_to_elastic_search
1. install java
2. sudo apt-get install npm
3. Download latest ES https://www.elastic.co/downloads/elasticsearch
wget <PASTE_LINK>
4. sudo dpkg -i elasticsearch-<version>.deb
5. (optional) sudo update-rc.d elasticsearch defaults
Configure it
The Elasticsearch configuration files are in the /etc/elasticsearch
@AndreiD
AndreiD / secure_nginx
Last active September 19, 2016 11:19
secure_nginx
# always redirect to https ?
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
=====================
@AndreiD
AndreiD / secret_message
Created November 2, 2016 15:42
Secret_Message
Secret Message:
01100001010010000101001000110000011000110100100001001101001101100100110001111001001110010110111001100001010110000101001001101111011001000101011101001001011101010101100100110010001110010111010001001100001100000110010001110000011000110110110101111000011110100101011000110010011010000111011001010001001100100011100101101011010110100101010101101100011101010101000101101110010101100111001101011010001100100100011001111001011000010101011101000101011101100101010101101101010101100111101001100010001100110101011001111001010110010011001001010110011110100100110000110010010010100111001101100010001100100100100101110110011000100101011101000110011110100110010001000111010101100111100101001100001100100011100100110000011000010100011101010110011110010101100000110011010011100011000001100100010101110101101001101101010011000011001000110001011011000110001001101110010100100111011001100011011011000011100101110000011000100110111001011010011100000110010001000111010001100011000001100001010101110011100101110101010011000110110
@AndreiD
AndreiD / flatten_dir.go
Last active May 26, 2018 18:04
Go Golang flatten directory -> read a directory of directories and extract files to another directory
package main
import (
"path/filepath"
"os"
"fmt"
)
const target_directory = "C:\\Users\\WHO?\\Documents\\target\\"
const destination_directory = "C:\\Users\\WHO?\\flatten\\"
@AndreiD
AndreiD / gist:72dcc49965e4c51466428d5187faa288
Created July 19, 2018 07:01
Docker Compose Cheatsheet
Docker - Compose Cheatsheet
docker-compose logs --tail 100 rabbit. (rabbit is name of the instance)
docker-compose logs | grep error
The -f flag causes the docker logs command to act like the tail -f command and watch the container’s standard output.
docker-compose logs --tail="10" -f Service
@AndreiD
AndreiD / genesis_poa_geth.json
Last active September 13, 2018 07:54
genesis.json
{
"config": {
"chainId": 4340,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
@AndreiD
AndreiD / electronen_popis_bulgaria.md
Last active August 28, 2018 18:28
braa.bg braa bulgaria electronen podpis instalatzya info notary

Instructions installing Electronic Podpis Bulgaria braa.bg braa bulgaria electronen podpis instalatzya info notary


Step #1: Required Software

download and install java8, both 32bits & 64bits write in google: "java8 jre install" and click the first link accept cookies, click on check radio button for accept license, download

@AndreiD
AndreiD / MY NGINX CHEAT SHEET
Last active July 13, 2020 10:27
NGINX CHEAT SHEET
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=1r/s;
server {
listen 80 default_server;
listen [::]:80 default_server;
client_max_body_size 5M;
@AndreiD
AndreiD / my_docker_cheetsheet.md
Last active June 1, 2019 12:58
My Docker Cheatsheet

Usefull

clear everything with docker

purge_docker.sh

docker system prune -a
docker images purge
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)