I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_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
panic: runtime error: invalid memory address or nil pointer dereference | |
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xf1716c] | |
goroutine 19174237 [running]: | |
code.gitea.io/gitea/models.(*Repository).getOwnerName(0x0, 0x37c5460, 0xc00016a700, 0x1d00447, 0x7) | |
/home/git/go/src/code.gitea.io/gitea/models/repo.go:545 +0x2c | |
code.gitea.io/gitea/models.(*Repository).mustOwnerName(0x0, 0x37c5460, 0xc00016a700, 0xc004035a40, 0x10) | |
/home/git/go/src/code.gitea.io/gitea/models/repo.go:571 +0x43 | |
code.gitea.io/gitea/models.(*Repository).repoPath(0x0, 0x37c5460, 0xc00016a700, 0x35, 0x0) | |
/home/git/go/src/code.gitea.io/gitea/models/repo.go:723 +0x3f |
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
[Macaron] 2019-08-14 10:30:05: Completed GET /serviceworker.js 200 OK in 3.143384ms | |
fatal error: concurrent map writes | |
fatal error: concurrent map writes | |
goroutine 13736991 [running]: | |
runtime.throw(0x1a59557, 0x15) | |
/usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc007968728 sp=0xc0079686f8 pc=0x42f542 | |
runtime.mapassign(0x17fd180, 0xc0013fa510, 0xc007968928, 0x1a3e531) | |
/usr/local/go/src/runtime/map.go:682 +0x5c8 fp=0xc0079687b0 sp=0xc007968728 pc=0x40fef8 | |
strk.kbt.io/projects/go/libravatar.(*Libravatar).baseURL(0xc0007b7560, 0xc001542380, 0x0, 0xc001542380, 0x20, 0x20, 0x18b53a0) |
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
find . -path ./misc -prune -o -name '*.txt' -print | |
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print | |
find . -path ./database -prune -o -path ./docker-projects -prune -o -path "*/target/*" -prune -o -path "*/src/main/*" -prune -o -type f -name log4j.xml -print |
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
find . -not -path "./.git/*" -type f | xargs -I{} dos2unix {} |
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 | |
if [ -z "$1" ] | |
then | |
echo "no remote name" | |
exit -1 | |
fi | |
if [ -z "$2" ] | |
then | |
echo "no remote url" |
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
@Entity | |
public class Employee { | |
@Id long empId; | |
String empName; | |
... | |
} | |
public class DependentId { | |
String name; // matches name of @Id attribute | |
long emp; // matches name of @Id attribute and type of Employee PK |