Skip to content

Instantly share code, notes, and snippets.

getallunits=tcp://127.0.0.1:5556
activateunits=tcp://127.0.0.1:5556
getallsites=tcp://127.0.0.1:5556
activatesites=tcp://127.0.0.1:5556
getallverticals=tcp://127.0.0.1:5556
activateverticals=tcp://127.0.0.1:5556
getallarticles=tcp://127.0.0.1:5556
activatearticles=tcp://127.0.0.1:5556
getallpages=tcp://127.0.0.1:5556
activatepages=tcp://127.0.0.1:5556
@tokhi
tokhi / postgres.md
Last active December 17, 2017 23:18
postgresql commands

Some useful postgresql commands

#  start postgresql
/usr/lib/postgresql-9.0/bin/postgres -D /var/lib/postgresql/9.1/boom/ -c config_file=/etc/postgresql-9.0/postgresql.conf

#
# #psql dump:
pg_dump #host localhost #port 5555 #username "foo" #format tar #blobs #verbose #file "/home/tokhi/Documents/Castaclip/castaclip.master.130612.tmp" "verticals"
# # restore:
@tokhi
tokhi / ElasticSearch.md
Last active January 6, 2017 00:44
Elastic Search in simple words

Elastic Search

Elasticsearch is a real time search engine where a change to an index will be propegated to the whole cluster within a second.

An elasticsearch cluster indicated as one or more nodes, collection of nodes containing all the data, default cluster name is elasticserach.

A node is a single server and part of a cluster, node participate in searching and indexing.

Index is collection of documents equavalent to a database within a relational system, index name must be lowercase Type is represetn a class = table

@tokhi
tokhi / monit.md
Last active August 29, 2015 14:05
monit installation on gentoo

Monit Documentation

Note
Monit has to be configured through the root user.
Use sudo su - to login as root user.

Monit Installation

@tokhi
tokhi / ftp_sync.sh
Last active August 29, 2015 14:08
Via script below you can download and sync directories from a remote ftp server to your local directory and vice versa. This script also support utf-8 filenames
#!/bin/bash
HOST="example.com"
USER="user"
PASS="password"
FTPURL="ftp://$USER:$PASS@$HOST"
echo $FTPURL
LCD="/home/user/local/directory"
RCD="/ftp/remote/directory"
# sync remote directory to the local directory (download)
@tokhi
tokhi / git_commands.sh
Last active August 29, 2015 14:08
git fanky commands
# http://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History
# compare old commits with the new commit file changed
$ git log -p -2
# which files changed on a specific commit revision
$ git log --stat
# print each commit with a signle line and commit revision
git log --pretty=oneline
@tokhi
tokhi / rails.sh
Last active August 11, 2020 09:59
Some useful rails command
# adding a column to an existing table
rails g migration AddNameToUsers name:string
# or
rails generate migration add_image_to_pictures image_id:string
# to remove
rails d migration AddNameToUsers name:string
# remove column from model
rails g migration RemoveProjectIDFromProjects project_id:string
@tokhi
tokhi / unixToolbox.md
Last active December 17, 2023 20:43
Collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users.

#Unix Toolbox

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

##Unix Toolbox revision 14.4

The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
@tokhi
tokhi / docker.sh
Last active December 28, 2016 19:35
# install docker toolbox
# create docker machine:
#docker-machine create --driver virtualbox default
eval "$(docker-machine env default)"
# check the version
docker version
docker-compose build
docker-compose up
# nginx installation
@tokhi
tokhi / buergerbot.rb
Last active November 25, 2023 12:01 — forked from pbock/buergerbot.rb
Bürgerbot: Refreshes the Berlin Bürgeramt page until an appointment becomes available, then notifies you.
#!/usr/bin/env ruby
# make sure you the watir gem installed -> gem install watir
require 'watir'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification Burgerbot with title "%s"\'' % message
rescue StandardError => e