HTTP Method | URI | Action |
---|---|---|
GET | http://[hostname]/activity/api/v1/users | Retrive list of available users |
GET | http://[hostname]/activity/api/v1/users/[user_id] | Retrive a user's activity for the current day |
GET | http://[hostname]/activity/api/v1/users/[user_id]?date=dd-mm-yyyy | Retrive a user's activity for the specified day |
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
-- https://devcenter.heroku.com/articles/dynos | |
-- export DATABASE_URL=postgres://python:python@localhost:5432/python_db | |
-- alter timezone on a dyno | |
-- heroku config:add TZ=Europe/Moscow | |
-- alter timezone on a database | |
alter role uaclvvcazghplm set timezone = 'Europe/Moscow'; |
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
-- SQL comes from here | |
-- https://momjian.us/main/writings/pgsql/locking.pdf | |
-- cannot be a temporary view because other sessions must see it | |
create view lockview as | |
select | |
pid, | |
virtualtransaction as vxid, | |
locktype as lock_type, | |
mode as lock_mode, |
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
create table test | |
( | |
name character varying(20), | |
id character varying(20) not null | |
); | |
insert into test (name, id) values ('bar', ''); | |
insert into test (name, id) values ('foo', '11'); | |
insert into test (name, id) values ('foo', '22'); |
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
select | |
blocked_locks.pid as blocked_pid, | |
blocked_activity.usename as blocked_user, | |
blocked_activity.datname as database, | |
blocking_locks.pid as blocking_pid, | |
blocking_activity.usename as blocking_user, | |
blocked_activity.query as blocked_statement, | |
blocking_activity.query as blocking_statement | |
from pg_catalog.pg_locks blocked_locks | |
join pg_catalog.pg_stat_activity blocked_activity |
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
[ | |
{ | |
"name": "Top Level", | |
"parent": "null", | |
"children": [ | |
{ | |
"name": "Level 2: A", | |
"parent": "Top Level", | |
"children": [ | |
{ |
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
SQL> create table test_ins (x number(1)); | |
Table created. | |
SQL> insert into test_ins (x, x) values (1, 2); | |
insert into test_ins (x, x) values (1, 2) | |
* | |
ERROR at line 1: | |
ORA-00957: duplicate column name |
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
SQL> select * from nc_objects2; | |
OBJECT_ID PARENT_ID | |
---------- ---------- | |
0 | |
2 1 | |
1 | |
3 2 | |
SQL> select |
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
#!/usr/bin/env bash | |
size=1024 # MB | |
mount_point=$HOME/tmp | |
name=$(basename "$mount_point") | |
usage() { | |
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
"(default: mount)" >&2 | |
} |
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
Oracle snippets, patterns and other stuff. |