yum update tzdata
timedatectl set-timezone America/Sao_Paulo
import logging | |
from functools import wraps | |
import time | |
def measure_it(func): | |
""" | |
Decorator to measure the execution time of a method. | |
Measure and log the execution time to the console in ms. |
import time | |
import random | |
from functools import wraps | |
def stopwatch(func_in=None, *, show_time: bool = True, show_name: bool = True): | |
def do(annotated_function): | |
@wraps(annotated_function) | |
def func(*args, **kwargs): | |
tic = time.time() |
ssh <targe-ip-address> -l <user> -D <local-host>:<local-port>:<remote-localhost>:<remote-port> | |
# Ex.: | |
ssh 10.241.242.220 -l vagrant -L localhost:1234:localhost:9392 |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debugger unit test", | |
"type": "node", | |
"request": "launch", | |
"runtimeArgs": [ | |
"--inspect-brk", | |
"./node_modules/@vue/cli-service/bin/vue-cli-service.js", |
#!/bin/bash | |
echo $1 | base64 -d | json_pp |
yum update tzdata
timedatectl set-timezone America/Sao_Paulo
import requests | |
import threading | |
import logging | |
base_url = 'https://swapi.co/api/people/?search=skywalker' | |
def get_urls(): | |
data = requests.get(base_url).json() | |
logging.info("Results: %s.", data['results']) |
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init
-- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath>
-- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64
.vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)(() => { | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function work() { | |
console.log('Start sleeping'); | |
await sleep(5000); | |
console.log('Five seconds later'); |