This file contains 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 java.util.*; | |
import java.net.*; | |
public class ShowEth0PrimaryIp { | |
public static final String ETH0 = "eth0"; | |
public static void main(String[] args) throws Exception { | |
System.out.println(new ShowEth0PrimaryIp().getEth0PrimaryIp()); | |
} |
This file contains 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
<!DOCTYPE html> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Redirecting...</title> | |
<link rel=canonical href="http://www.kehlet.cx/subnetting-is-fun/index.html"> | |
<meta http-equiv=refresh content="0; url=http://www.kehlet.cx/subnetting-is-fun/index.html"> | |
<h1>Redirecting...</h1> | |
<a href="http://www.kehlet.cx/subnetting-is-fun/index.html">Click here if you are not redirected.</a> | |
<script>location='http://www.kehlet.cx/subnetting-is-fun/index.html'</script> |
This file contains 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
function my_explode($delimiter, $string, $limit = null) { | |
$array = call_user_func_array('explode', func_get_args()); | |
if (count($array) === 1 && strlen($array[0]) === 0) { | |
return array(); | |
} | |
return $array; | |
} |
This file contains 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
WITH table_opts AS ( | |
SELECT | |
pg_class.oid, relname, nspname, array_to_string(reloptions, '') AS relopts | |
FROM | |
pg_class INNER JOIN pg_namespace ns ON relnamespace = ns.oid | |
), storage_settings AS ( | |
SELECT | |
oid, relname, nspname, | |
CASE | |
WHEN relopts LIKE '%autovacuum_vacuum_threshold%' |
This file contains 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
schema | table | rowcount | dead_rowcount | autovacuum_threshold | expect_autovacuum | relfrozenxid_age | autovacuum_freeze_table_age | next_autovacuum_will_be_a_freeze | autovacuum_freeze_max_age | % til forced vacuum freeze | |
---------+---------+----------------+----------------+----------------------+-------------------+------------------+-----------------------------+----------------------------------+---------------------------+---------------------------- | |
public | table01 | 1,336,112,512 | 4,641,856 | 267,222,552 | | 165311956 | 1.5e+08 | yes | 2e+08 | 82.7% | |
public | table02 | 777,657,088 | 20,662,775 | 155,531,468 | | 165311956 | 1.5e+08 | yes | 2e+08 | 82.7% | |
public | table03 | 642,018,368 | 9 | 128,403,724 | | 165311956 | |
This file contains 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
mydb=> SELECT name, current_setting(name), source | |
mydb-> FROM pg_settings | |
mydb-> WHERE source NOT IN ('default', 'override'); | |
name | current_setting | source | |
---------------------------------+------------------+-------------------- | |
application_name | psql | client | |
archive_command | exit 0 | configuration file | |
archive_mode | on | configuration file | |
autovacuum | on | configuration file | |
autovacuum_analyze_scale_factor | 0.1 | configuration file |
This file contains 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
listen_addresses = '*' | |
port = 5432 | |
max_connections = 300 | |
shared_buffers = 2GB | |
work_mem = 10MB | |
maintenance_work_mem = 256MB | |
max_stack_depth = 8MB | |
wal_buffers = 16MB | |
checkpoint_segments = 32 | |
checkpoint_completion_target = .9 |
This file contains 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
psql (9.4.4) | |
Type "help" for help. | |
postgres=# | |
postgres=# SELECT name, current_setting(name), source | |
postgres-# FROM pg_settings | |
postgres-# WHERE source NOT IN ('default', 'override'); | |
name | current_setting | source | |
---------------------------------+----------------------------------+-------------------- | |
application_name | psql | client |
This file contains 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
SELECT | |
COALESCE(blockingl.relation::regclass::text,blockingl.locktype) as locked_item, | |
blockeda.procpid AS blocked_pid, | |
blockeda.current_query as blocked_query, | |
blockedl.mode as blocked_mode, | |
blockinga.procpid AS blocking_pid, | |
blockinga.current_query as blocking_query, | |
blockingl.mode as blocking_mode | |
FROM pg_catalog.pg_locks blockedl | |
JOIN pg_stat_activity blockeda ON blockedl.pid = blockeda.procpid |
This file contains 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
postgres=# SELECT version(); | |
version | |
--------------------------------------------------------------------------------------------------------------- | |
PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44), 64-bit | |
(1 row) | |
postgres=# SELECT name, current_setting(name), SOURCE | |
postgres-# FROM pg_settings | |
postgres-# WHERE SOURCE NOT IN ('default', 'override'); | |
name | current_setting | source |