Skip to content

Instantly share code, notes, and snippets.

View mikekenneth's full-sized avatar
🌍

Mike Houngbadji mikekenneth

🌍
View GitHub Profile
@mikekenneth
mikekenneth / postgres_queries_and_commands.sql
Created September 12, 2022 17:23 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
DROP TABLE if exists d_date;
CREATE TABLE d_date
(
date_dim_id INT NOT NULL,
date_actual DATE NOT NULL,
epoch BIGINT NOT NULL,
day_suffix VARCHAR(4) NOT NULL,
day_name VARCHAR(9) NOT NULL,
day_of_week INT NOT NULL,
@mikekenneth
mikekenneth / fix-wsl2-dns-resolution
Created April 6, 2021 13:08 — forked from coltenkrauter/fix-wsl2-dns-resolution
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@mikekenneth
mikekenneth / .gitignore
Created July 1, 2020 08:26 — forked from santoshpy/.gitignore
gitignore file for django project
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
@mikekenneth
mikekenneth / Install NVIDIA Driver and CUDA.md
Created November 25, 2019 18:51 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@mikekenneth
mikekenneth / Install Python 3.7.5 on CentOS 7
Last active May 7, 2022 02:41 — forked from wpupru/Install Python 3.7.0 on CentOS 7
Install Python 3.7.5 on Centos 7
Install Python 3.7.5 on CentOS/RHEL 7
1.Requirements:
yum install gcc openssl-devel bzip2-devel libffi-devel
# Below requirement for djang projects
yum install readline-devel tk-devel tk-devel openssl-devel sqlite-devel openssl tk readline sqlite
2.Download Python 3.7: