-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostCreateCommand.sh
59 lines (52 loc) · 1.46 KB
/
postCreateCommand.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
function configure_vscode {
if [ ! -d .vscode ]; then
mkdir .vscode
cat <<EOL > ".vscode/c_cpp_properties.json"
{
"configurations": [
{
"name": "Postgres Development Configuration",
"includePath": [
"\${workspaceFolder}/**",
"\${workspaceFolder}/src/include/",
"\${workspaceFolder}/../build/src/include/"
]
}
],
"version": 4
}
EOL
cat <<EOL > ".vscode/pgsql_hacker_helper.json"
{
"version": 3,
"typedefs": "src/tools/pgindent/typedefs.list"
}
EOL
fi
cp .devcontainer/launch.json .vscode/
cp .devcontainer/tasks.json .vscode/
}
# https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD
function configure_coredumps {
sudo sh -c "echo 'core.%p.sig%s.%ts' > /proc/sys/kernel/core_pattern"
}
function configure_perf {
sudo sh -c "echo 0 > /proc/sys/kernel/kptr_restrict"
sudo su -c "echo -1 > /proc/sys/kernel/perf_event_paranoid"
if [ ! -d /opt/freedom/tools/FlameGraph ]; then
git clone --depth 1 https://github.com/brendangregg/FlameGraph.git /opt/freedom/tools/FlameGraph
fi
}
function configure_pg_plugins {
if [ ! -d /opt/freedom/extensions/pg_plugins ]; then
git clone --depth 1 https://github.com/michaelpq/pg_plugins.git /opt/freedom/extensions/pg_plugins
fi
}
function main {
configure_coredumps
configure_vscode
configure_perf
configure_pg_plugins
}
main $@