Skip to content

Instantly share code, notes, and snippets.

View iamnotagentleman's full-sized avatar
👽
Focusing

Veli EROGLU iamnotagentleman

👽
Focusing
View GitHub Profile
@codingjoe
codingjoe / geodjango_macOS_arm64.md
Created March 11, 2021 10:29
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
  1. Install PostgreSQL with PostGIS via Postges.app
  2. Install brew as recommended.
  3. Install dependencies:
    brew install geos gdal
    
  4. Add the following to your settings:
    # settings.py
    

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')

@cromat
cromat / wsl-redis-start.md
Last active January 8, 2024 21:32
Run redis inside WSL as background service on Windows startup

Step by step guide to run redis-server inside WSL(Windows Subsystem for Linux) on Windows

I have tried to setup redis as starting background task with wsl-autostart, Task Scheduler and with lot vbs scripts including one described here but none of them seemed to work.

In the end I have manually created a simple one that does the job. This script basically starts a hidden Ubuntu Window and starts redis-server inside it.

  1. Install WSL (this is tested with Ubuntu 18.04 version)
  2. Install redis-server inside WSL sudo apt install redis-server
  3. Add sudo permission to your user to execute service command without password
@joe-henke
joe-henke / knapsack.py
Created March 2, 2016 08:07
Knapsack problem dynamic programming no repetition of items
# Uses python3
import sys
def knapSackNoRep(capacity, bars):
amount = len(bars)
value=[[0 for row in range(0, amount+1)] for col in range(0, capacity+1)]
for i in range(1, amount+1):
wi = bars[i-1]
@scturtle
scturtle / server.py
Last active September 28, 2024 03:46
python socks5 proxy server with asyncio (async/await)
#!/usr/bin/env python3.5
import socket
import asyncio
from struct import pack, unpack
class Client(asyncio.Protocol):
def connection_made(self, transport):
self.transport = transport
self.server_transport = None