Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r |
This file contains 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 csv | |
import os | |
import types | |
from flask import Flask, jsonify, make_response, request, url_for, send_file | |
from app import celery, firebase, firestore_db | |
from app.post_tasks import * | |
from app.master_admin_tasks import check_group_outdated_accounts_token | |
from firebase_admin import db as firebase_db, firestore | |
from . import post | |
from ..models import * |
This file contains 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
- Add `gem 'tzinfo-data'` to the Gemfile. | |
- Add `tzdata` to the Dockerfile | |
``` | |
RUN apk update \ | |
&& apk add build-base \ | |
tzdata | |
``` | |
- Build `docker-compose build` or `docker-compose up --build` | |
- Enjoy the life |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
This file contains 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
class Person < ActiveRecord::Base | |
# This manual SQL query... | |
scope :allowed_to_eat_cheese, joins( | |
<<-SQL | |
INNER JOIN cities ON people.city_id = cities.id | |
INNER JOIN states ON cities.state_id = states.id | |
SQL | |
).where('states.allows_cheese_consumption' = 'Yeppers') |
This file contains 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
""" | |
Code that goes along with the Airflow tutorial located at: | |
https://github.com/airbnb/airflow/blob/master/airflow/example_dags/tutorial.py | |
""" | |
from airflow import DAG | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.operators.generic_transfer import GenericTransfer | |
from airflow.contrib.hooks import FTPHook | |
from airflow.hooks.mysql_hook import MySqlHook |
This file contains 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
rm /Volumes/TADA68\ \ /FLASH.BIN | |
cp ~/Downloads/FLASH.bin /Volumes/TADA68\ \ /FLASH.BIN |
This file contains 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
## just some ways to check if a url exists | |
# method 1 - from Simone Carletti | |
require "net/http" | |
url = URI.parse("http://www.google.com/") | |
req = Net::HTTP.new(url.host, url.port) | |
res = req.request_head(url.path) | |
# method 2 - from some kid on the internet | |
require 'open-uri' |
This file contains 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
INSTALL JAVA | |
$ sudo apt-get update && sudo apt-get install default-jre | |
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
$ sudo apt-get update && sudo apt-get install elasticsearch | |
$ sudo update-rc.d elasticsearch defaults 95 10 | |
$ sudo service elasticsearch restart | |
$ sudo service elasticsearch status |
NewerOlder