start new:
tmux
start new with session name:
tmux new -s myname
async def do_something(): | |
for _ in range(3): | |
await produce() | |
await asyncio.sleep(5) | |
async def produce(): | |
id_ = str(uuid.uuid4()) | |
global global_task_queue | |
task = str(uuid.uuid4()) + ': CONSUME ME IN ' + str(randint(5, 9)) |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Example of Singleton design pattern | |
# Copyright (C) 2011 Radek Pazdera | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
import redis | |
r = redis.Redis() | |
r.set('target-key', 1) | |
with r.pipeline() as pipe: | |
artificial_race_condition_flag = True # Create race condition the first time pipeline executes | |
while True: # Keep retrying until success | |
try: |
#![allow(unused_variables)] | |
fn main() { | |
let simulated_user_specified_value = 100; | |
let simulated_random_number = 30; | |
generate_workout( | |
simulated_user_specified_value, | |
simulated_random_number | |
); | |
} |
*/5 * * * * . /path/to/.ssh/agent/ssh_agent && cd /path/to/local/repo && (echo "<<<<<<<<<<<<<<<< fetching all from remote" && /bin/date "+DATE: \%m-\%d-\%Y TIME: \%H:\%M:\%S" && /usr/local/bin/git fetch --all --prune && echo ">>>>>>>>>>>>>>>> done fetching") >> cron.out 2>&1 |
import mailbox | |
def read_mbox(mbox_path, username): | |
box = mailbox.mbox(mbox_path) | |
payload = [] | |
for msg in box: | |
payload.append(read_payload(msg, msg)) #if msg['from'].find(username) != -1 else '' | |
return ''.join(payload) | |
#!/bin/bash | |
apt-get update && | |
apt-get check && | |
apt-get upgrade -f && | |
apt-get dist-upgrade -f && | |
dpkg --configure -a && | |
apt-get autoclean && | |
apt-get autoremove -f && | |
aptitude purge '~c' |
Preliminary Updates and Installations
(http://markus.com/install-theano-on-aws/)
sudo apt-get update
sudo apt-get -y dist-upgrade