Skip to content

Instantly share code, notes, and snippets.

View tuannvm's full-sized avatar
🎯
Focusing

Tommy Nguyen tuannvm

🎯
Focusing
View GitHub Profile
@tuannvm
tuannvm / plan.txt
Last active January 27, 2016 23:46
postgre 9.1 to 9.4
#### For Dev1 first ####
#### announce an 30 mins maintenance ####
####backup postgre 9.1 db (about 10 mins)########
su - postgres
pg_dumpall > <backup-db>.sql
####install postgre 9.4 (about 1 mins)####
wget http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm
- Receive feed: test1.vivatv.vn:80 (rtmp)
- Wowza ACP: test2.vivatv.vn:8443 (http)
- Feed output: test3.vivatv.vn:8080 (http)
bắn feed:
https://i.imgur.com/tvhRZb9.jpg
Link play:
http://test3.vivatv.vn:8080/vivatv-open/<stream key>_aac/playlist.m3u8
#!/bin/bash
root=/root/devops/tasks
find $root -type f -name '*README.txt*' > $root/file.txt
echo "" > $root/subjects.txt
while read line; do
sed -n '/\-\-\-/,/\-\-\-/{/\-\-\-/b;/\-\-\-/b;p}' "$line" >> $root/subjects.txt
done < $root/file.txt
sed -i '/^\s*$/d' $root/subjects.txt
import os
import re
BASEPATH = 'root/devops/tasks'
courses = []
lastLine = []
folders = os.listdir(BASEPATH)
for folder in folders:
# Standard library imports...
from unittest.mock import Mock, patch
# Third-party imports...
from nose.tools import assert_is_not_none
# Local imports...
from project.services import get_todos
"finn.yml"
################
---
- hosts: web
vars:
user: "finn"
public_key: "{{ lookup('file', 'finn.pub') }}"
deleted_user: "chip"
deleted_public_key: "{{ lookup('file', 'chip.pub') }}"
class Student():
def __init__(self, name, school):
self.name = name
self.school = school
self.mark = []
def average(self):
return sum(self.mark) / len(self.mark)
def friend(self, friend_name):
class Store:
def __init__(self, name):
self.name = name
self.items = []
def add_item(self, name, price):
self.items.append({
'name': name,
'price': price
})
@tuannvm
tuannvm / error.txt
Last active January 17, 2017 05:48
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1994, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask_restful/__init__.py", line 271, in error_router
return original_handler(e)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask_restful/__init__.py", line 268, in error_router

GLaCOS (Genetic Lifeform and Cloud Operating System), your AI research assistant, had nothing to do lately, so you decided to create a little game for him to keep him entertained. You downloaded the cloud GLaCOS operates and stored it under the /root/devops/cloud directory. Here are the rules of the game you came up with.

There are a bunch of folders and files under the root/devops/cloud directory. The are two types of files in the system:

A hint. Each hint file starts with a line containing a single "Hint" word (without quotes or leading/trailing whitespace characters). The second line contains a sequence (possibly empty) of words "up" and "down", separated by a single whitespace character. Not a hint. It is guaranteed that the first line of the such a file is not "Hint". The goal of the game is to find a secret folder. It is known that there is a sequence of hints that leads to it, and that the first hint is called start.hint and is located in root/devops/cloud. Here's how to win the game starting with th