Skip to content

Instantly share code, notes, and snippets.

View imran-vz's full-sized avatar
🎓
Mostly Learning

Mohammed Imran imran-vz

🎓
Mostly Learning
View GitHub Profile
@imran-vz
imran-vz / Doc.MD
Created November 18, 2024 07:56
Guide to using cursor in linux
@imran-vz
imran-vz / creality-print.desktop
Created November 3, 2024 18:31
This is the .desktop for Creality Print.
[Desktop Entry]
Name=Creality Print
GenericName=Creality Print
Comment=Creality Print
Exec=/usr/bin/creality-print
Icon=/usr/share/pixmaps/creality-print.png
Terminal=false
Type=Application
Categories=Utility;Application;
StartupNotify=false
@imran-vz
imran-vz / encdec.js
Created November 17, 2023 09:45
Encrypt and decrypt data on the browser using CryptoSubtle
/**
*
* @param {string} message
* @returns
*/
function getMessageEncoding(message) {
const enc = new TextEncoder();
return enc.encode(message);
}
@imran-vz
imran-vz / docker.compose.pgadmin.yml
Created August 12, 2022 08:29
Use PgAdmin with docker compose. You can access it on http://pgAdmin.localhost
version: '3'
services:
proxy:
image: traefik:v2.8
command:
- --api.insecure=true
- --providers.docker
ports:
- "80:80"
@imran-vz
imran-vz / compose.cyberchef.yaml
Last active February 20, 2023 04:11
Use cyberchef with docker compose. You can access it on http://cyberchef.localhost
services:
proxy:
image: traefik:v2.9
command:
- --api.insecure=true
- --providers.docker
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@imran-vz
imran-vz / docker-compose.postgres.yml
Last active September 20, 2023 09:43
Use Postgres with docker-compose.
version: '3.8'
services:
postgres:
container_name: postgres
image: postgres:14.3-alpine
restart: always
environment:
POSTGRES_USER: <USER>
POSTGRES_PASSWORD: <PASSWORD>
@imran-vz
imran-vz / docker-compose.redis.yml
Created June 17, 2022 08:47
Use Redis with docker-compose.
version: '3.8'
services:
redis:
image: redis:7.0.2-alpine
restart: always
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass <PASS>
volumes:
@imran-vz
imran-vz / omit_object_keys.ts
Last active February 18, 2022 12:50
Fully typed function to omit/remove keys from an object.
export function omit<T extends Record<string, any>, K extends Array<keyof T>>(object: T, keys: K): Omit<T, keyof K> {
if (!object) return {} as T;
if (!keys) return object;
const objectKeys = Object.keys(object) as Array<keyof T>;
return objectKeys
.filter((key) => !keys.includes(key))
.reduce((obj, key) => {
obj[key] = object[key];

Docker

Images

  • Remove dangling images

    docker rmi $(docker images -f "dangling=true" -q)
  • List current images

server {
listen 80 default_server;
server_name _;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 0;