This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.html; do mv "$file" "${file/.html/.php}"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
if __name__ == '__main__': | |
for subdir, dirs, files in os.walk(os.getcwd()): | |
for file in files: | |
x = os.path.join(subdir, file) | |
if x.endswith("png"): | |
# Convert image | |
print "Converting {}".format(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func externalIP() (string, error) { | |
ifaces, err := net.Interfaces() | |
if err != nil { | |
return "", err | |
} | |
for _, iface := range ifaces { | |
if iface.Flags&net.FlagUp == 0 { | |
continue // interface down | |
} | |
if iface.Flags&net.FlagLoopback != 0 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removes all .DS_Store files from the working directory | |
find . -name ".DS_Store" -delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Virus { | |
public fun mutate() | |
public fun spread() { | |
println("Spreading the virus...") | |
} | |
} | |
class CoronaVirus: Virus { | |
override fun mutate() { | |
println("Mutating the corona virus...") |
OlderNewer