Skip to content

Instantly share code, notes, and snippets.

View clemkofi's full-sized avatar

Clement Kofi Nartey clemkofi

View GitHub Profile
@clemkofi
clemkofi / examples-sed
Created February 25, 2026 08:42 — forked from dlfinis/examples-sed
Examples of Sed' Use
The syntax of sed command replacement is:
$ sed 's/find/replace/' file
This sed command finds the pattern and replaces with another pattern. When the replace is left empty, the pattern/element found gets deleted.
Let us consider a sample file as below:
$ cat file
Linux
@clemkofi
clemkofi / Postgres-CLI-commands
Last active March 7, 2025 19:38
Postgres-CLI-commands
To dump a postgres DB use:
pg_dump 'postgres://postgres.mirtteddfgyhujqugnln:<password>@aws-0-eu-central-1.pooler.supabase.com:5432/postgres' -f backup.dump
To restore the postgres DB to the existing DB or a totally new one use:
psql 'postgresql://postgres:<password>@db.yhrnbiuownbomnocw.supabase.co:5432/postgres' < backup.dump
if the dump was made with a custom flag then use:
pg_restore 'postgresql://postgres:<password>@db.yhrnbiuownbomnocw.supabase.co:5432/postgres' -F custom backup.dump
@clemkofi
clemkofi / ubuntu-nextjs-nginx-config-file
Created February 12, 2024 21:04 — forked from oelbaga/01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#nginx config file for Nextjs App
#place in /etc/nginx/sites-available/name_of_config_file
server {
listen 80;
server_name domainname.com;
gzip on;
gzip_proxied any;
gzip_types application/javascript application/x-javascript text/css text/javascript;
gzip_comp_level 5;
@clemkofi
clemkofi / fortune500gist.ipynb
Created October 18, 2018 12:09
Fortune 500 companies Profit and Revenue Analysis from 1955 to 2005
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.