This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo apt-get install postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1 pgadmin3 -t squeeze-backports | |
| $ nmap localhost | |
| $ sudo -u postgres psql | |
| # CREATE ROLE your_uid WITH SUPERUSER LOGIN PASSWORD 'pass'; | |
| # CREATE DATABASE your_uid; | |
| # \q | |
| $ psql -U your_uid -W |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.ffbit.twitter; | |
| import java.io.Serializable; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| import javax.persistence.Access; | |
| import javax.persistence.AccessType; | |
| import javax.persistence.Basic; | |
| import javax.persistence.CascadeType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 127.0.0.1 googleads.g.doubleclick.net | |
| 127.0.0.1 marketgid.com lady.marketgid.com | |
| 127.0.0.1 b.ddestiny.ru | |
| 127.0.0.1 imgn.dt00.net mg.dt00.net | |
| 127.0.0.1 begun.ru | |
| 127.0.0.1 colo1.adriver.ru adriver.ru un1.adriver.ru ad.adriver.ru content.adriver.ru | |
| 127.0.0.1 tns-counter.ru | |
| 127.0.0.1 banners.gamexp.ru | |
| 127.0.0.1 counter.spylog.com spylog.com | |
| 127.0.0.1 images.gamenet.ru gamenet.ru go.gamenet.ru |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| org.hamcrest.CoreMatchers | |
| org.junit.Assert | |
| org.junit.matchers.JUnitMatchers | |
| org.mockito.Mockito |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Before | |
| public void ${setUp}() throws Exception { | |
| ${import:import('org.junit.Before')}${cursor} | |
| } | |
| @Test | |
| public void itShould${DoSomething}() throws Exception { | |
| ${import:import('org.junit.Test')}${cursor} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| time = (3.3E-4, 5.0E-9, 6.25E-9) | |
| data = (1, 2, 4, 8, 16, 32, 64) | |
| for t in time: | |
| print("== %s ==" % t) | |
| for d in data: | |
| result = math.pow(d * 1000, 2) * t | |
| print("%s %f" % (d, result)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = 100 | |
| candles = [False] * n | |
| offset = 1 | |
| for dwarf in xrange(n): | |
| dwarf_num = dwarf + offset | |
| for candle in xrange(n): | |
| candle_num = candle + offset | |
| if not candle_num % dwarf_num: | |
| candles[candle] = not candles[candle] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SCRIPT_DIR=`dirname $0` | |
| if [ -z $1 ] | |
| then | |
| echo "ERROR: Provide an artifact id" | |
| exit -1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ls -l /dev/disk/by-uuid | |
| sudo nano /etc/fstab | |
| UUID=aaaaaaaa-aaaa-aaaa-aaaa-c5d849f7592c /ssd ext4 noatime,nodiratime,discard,errors=remount-ro 0 1 | |
| sudo mount -a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DB="dbname" | |
| HOST="127.0.0.1" | |
| UNAME="uname" | |
| pg_dump --host=$HOST --port=5432 --username=$UNAME $DB | gzip -c > $DB.backup.gz |