Skip to content

Instantly share code, notes, and snippets.

@timotta
timotta / dependencies.json
Created March 10, 2021 20:20
Lib versions that works together on package.json
{
"babel-preset-expo": "^5.0.0",
"babel-preset-react-native": "^5.0.0",
"jest": "^24.8.0",
"jest-expo": "^26.0.0",
"react-test-renderer": "^16.2.0",
"react": "^16.3.0",
"react-native": "0.61.5",
"@babel/core": "7.13.10"
}
SELECT *, pg_size_pretty(total_bytes) AS total
, pg_size_pretty(index_bytes) AS INDEX
, pg_size_pretty(toast_bytes) AS toast
, pg_size_pretty(table_bytes) AS TABLE
FROM (
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (
SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME
, c.reltuples AS row_estimate
, pg_total_relation_size(c.oid) AS total_bytes
, pg_indexes_size(c.oid) AS index_bytes
-- show tables
SELECT * FROM pg_catalog.pg_tables;
-- describe table
select column_name, data_type, character_maximum_length from INFORMATION_SCHEMA.COLUMNS where table_name = 'tablename';
jupyter nbconvert --to script config_template.ipynb
sudo cp jupyter.service /usr/lib/systemd/system/
sudo systemctl enable jupyter.service
sudo systemctl daemon-reload
sudo systemctl restart jupyter.service
journalctl -u jupyter > /tmp/test.txt && cat /tmp/test.txt
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
# Step 1 and Step 2 details are here..
# ------------------------------------
ExecStart=/usr/local/bin/jupyter notebook --ip=0.0.0.0 --no-browser
User=ubuntu
sudo jupyter notebook --allow-root --ip=0.0.0.0 --port=80 --no-browser
*~
.settings
.project
.factorypath
.cache
.classpath
.tmpBin
*.pyc
.cache-main
.pydevproject
@timotta
timotta / erase.sh
Created February 14, 2019 19:18
Erase HD
dd if=/dev/urandom of=/dev/sdX bs=1M
JOBID=`cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 10 | head -n 1`
gcloud ml-engine jobs submit training $JOBID \
--module-name=$MODULE \
--region=us-central1 \
--package-path=$PACKAGE \
--job-dir=$BUCKET \
--project=$PROJECT \
--scale-tier=basic_gpu