Skip to content

Instantly share code, notes, and snippets.

@andineck
andineck / hosteurope_apache.sh
Created November 21, 2013 14:13
apache config ports
nano /etc/apache2/ports.conf
>NameVirtualHost *:3080
>Listen 3080
nano /etc/apache2/sites-available/default
> <VirtualHost *:3080>
sudo service apache2 restart
@andineck
andineck / starter.sh
Created November 22, 2013 12:36
startup script
touch starter.sh
chmod 754 starter.sh
nano starter.sh
# file content:
#!/bin/sh
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
then
export PATH=/usr/local/bin:$PATH
@andineck
andineck / kill_process.sh
Created November 22, 2013 13:11
list node processes
# kill specific process, check with 'ps -aufx | grep node'
kill <pidnr>
# kill all node processes
killall -9 node
# terminate forever process, check with 'forever list'
forever stop <number 0..n>
@andineck
andineck / snmp.sh
Last active January 2, 2016 19:39
snmp
# manual
http://wiki.ubuntuusers.de/SNMP
# install
# http://l3net.wordpress.com/2013/05/12/installing-net-snmp-mibs-on-ubuntu-and-debian/
sudo apt-get install snmp snmpd
sudo nano /etc/snmp/snmp.conf
# comment out this line
> # mibs :
sudo nano /etc/snmp/snmptrapd.conf
@andineck
andineck / mongo-db.md
Last active January 12, 2016 06:49
spring notes, mongodb

http://docs.spring.io/spring-data/mongodb/docs/1.5.4.RELEASE/reference/html/mapping-chapter.html

6.3.1 Mapping annotation overview

The MappingMongoConverter can use metadata to drive the mapping of objects to documents. An overview of the annotations is provided below

  • @Id - applied at the field level to mark the field used for identiy purpose.
  • @Document - applied at the class level to indicate this class is a candidate for mapping to the database. You can specify the name of the collection where the database will be stored. @Document(collection = "collectionName")
  • @DBRef - applied at the field to indicate it is to be stored using a com.mongodb.DBRef.
  • @Indexed - applied at the field level to describe how to index the field.
@andineck
andineck / assemble.js
Created May 25, 2016 07:18
assemble javascript template strings
// code from http://stackoverflow.com/questions/29771597/how-can-i-construct-a-template-string-from-a-regular-string
// + handling unlimited arguments
function assemble(literal, params) {
var args = [].slice.apply(arguments)
args.shift()
return new Function(args, "return `"+literal+"`")
}
@andineck
andineck / 1 git shortcut.md
Last active November 22, 2016 08:03
git shortcut save

git shortcuts

@andineck
andineck / 0_readme.md
Last active May 8, 2018 03:47
database messaging distributed kafka

database, messaging, distributed system, kafka