Skip to content

Instantly share code, notes, and snippets.

View jimfilippou's full-sized avatar
:shipit:

Dimitrios Filippou jimfilippou

:shipit:
View GitHub Profile
@jimfilippou
jimfilippou / clean.sh
Created October 15, 2017 12:22
Clear cached ram
# To free pagecache:
# echo 1 > /proc/sys/vm/drop_caches
# To free dentries and inodes:
# echo 2 > /proc/sys/vm/drop_caches
# To free pagecache, dentries and inodes:
# echo 3 > /proc/sys/vm/drop_caches
sudo sync && sudo sysctl -w vm.drop_caches=3
@jimfilippou
jimfilippou / hotel-shitty-bed.py
Created October 8, 2017 14:21
No coins arround? figure out who is gonna sleep on the shitty bed at the hotel, using python
import random, os
def main():
while(True):
print "Press enter to choose who is gonna sleep on the shitty bed."
c = raw_input()
if c == ".exit":
break
else:
@jimfilippou
jimfilippou / backend.bat
Last active June 8, 2020 17:49
A list of useful and time saving batch files for rapid Flask application development.
@echo off
cd %USERPROFILE%/Desktop/Projects/Bandicoot 2/env/Scripts
call activate.bat
cd %USERPROFILE%/Desktop/Projects/Bandicoot 2
IF "%1"=="public" GOTO PUBLIC
python manage.py runserver
:PUBLIC:
python manage.py runserver --host 0.0.0.0
@jimfilippou
jimfilippou / revive.py
Last active September 22, 2017 11:36
Checks if Redis instance is running
from fabric.api import run,settings
import time, datetime
# host="x.x.x.x"
def redis():
with settings(warn_only=True, host_string=host, user="server1", key_filename="cert.pem"):
r = run("redis-cli ping", True)
if r == "PONG":