Skip to content

Instantly share code, notes, and snippets.

View noherczeg's full-sized avatar

Norbert Csaba Herczeg noherczeg

View GitHub Profile
@noherczeg
noherczeg / files_contain_string.txt
Created November 12, 2014 14:11
linux command search for files containing string
grep -H -R "search string" /etc/* | cut -d: -f1
@noherczeg
noherczeg / linux_x_days_before
Created November 25, 2014 14:02
linux commad to get date before x days
date '+%Y-%m-%d' --date='1 days ago'
Haz: BITFENIX Prodigy Fehér 22.000 http://ipon.hu/webshop/product/bitfenix_prodigy_feher/240852
Alaplap: ASROCK B75M-ITX 20.000 http://ipon.hu/webshop/product/asrock_b75m_itx/204117
SSD: CORSAIR 120GB Force LS 20.200 http://ipon.hu/webshop/product/corsair_120gb_force_ls_sata3_25_cssd_f120gbls/508495
Processzor: INTEL Core i3-3240 3.40GHz 1155 BOX 30.000 http://ipon.hu/webshop/product/intel_core_i3_3240_3.40ghz_1155_box/264031
RAM: CORSAIR 8GB Vengeance LP DDR3 1600Mhz CL10 22.200 http://ipon.hu/webshop/product/corsair_8gb_vengeance_lp_ddr3_1600mhz_cl10_cml8gx3m1a1600c10/212822
----------------------------------------------------------------------
Osszesen: 114.200
@noherczeg
noherczeg / AbstractTransformer.java
Last active August 29, 2015 14:11
Prototype generic transformer parent class
package hu.noherczeg.guildwatch.core;
import java.lang.reflect.ParameterizedType;
import java.util.LinkedList;
import java.util.List;
/**
* The source(es) parameter in all the methods should always be final, to ensure that it's values don't change
* while the iterations are in progress!
*
@noherczeg
noherczeg / llinux_distro.txt
Created December 28, 2014 12:15
display linux distribution data
cat /etc/*-release
@noherczeg
noherczeg / mediabox.txt
Created December 28, 2014 20:49
dat bokz
mobo: ASROCK Q1900-ITX 25.000 http://ipon.hu/webshop/product/asrock_q1900_itx/649253
ram: CSX 2GB Notebook DDR3 1333MHz CL9 5.300 http://ipon.hu/webshop/product/csx_2gb_notebook_ddr3_1333mhz_cl9_csxa_so_1333_2g/177423
HDD1: WD Red 4TB 5400rpm 64MB SATA3 WD40EFRX 47.000 http://ipon.hu/webshop/product/wd_red_4tb_5400rpm_64mb_sata3_wd40efrx/509244
SSD: KINGSTON 30GB SSDNow S200 12.000 http://ipon.hu/webshop/product/kingston_30gb_ssdnow_s200_sata3_25_ss200s3_30g/443398
haz: FRACTAL DESIGN Node 304 22.300 http://ipon.hu/webshop/product/fractal_design_node_304_fekete/291647
psu: CHIEFTEC iArena 350W 8.200 http://ipon.hu/webshop/product/chieftec_iarena_350w_gpa_350s/181189
------------------------------------------------------------------
sum: 120.000
@noherczeg
noherczeg / subfoldersize.txt
Created January 13, 2015 17:36
Size of subfolders summarized from a given path without permission errors
du -cBM --max-depth=1 2>/dev/null | sort -nr | head -n 20
@noherczeg
noherczeg / pg_remote_access
Last active August 29, 2015 14:13
postgresql allow remote access
$ nano /etc/postgresql/9.3/main/pg_hba.conf
# past to the end of the line:
# source db role from mode
host all all 0.0.0.0/0 trust
$ service postgresql restart
@noherczeg
noherczeg / pg_db_schema_create_grant
Last active August 29, 2015 14:13
create db, schema, user, search path correctly, finally...
$ su - postgres
$ psql
# CREATE DATABASE hng;
# \connect hng;
# CREATE SCHEMA IF NOT EXISTS hng AUTHORIZATION hng;
# GRANT ALL PRIVILEGES ON DATABASE hng TO hng;
# ALTER USER hng SET SEARCH_PATH TO hng;
# ALTER SCHEMA hng OWNER TO hng;
@noherczeg
noherczeg / vps_swap_activation
Last active August 29, 2015 14:13
vps swap creation put simple
# tested on ubuntu 14.04
# ------------------------------------------
# CREATE SWAP:
# ------------------------------------------
$ swapon -s
$ free -m
$ sudo fallocate -l 4G /swapfile
$ ls -lh /swapfile