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
from flask import current_app, Blueprint, render_template | |
from database import db_session | |
from model import Product | |
admin = Blueprint('admin', __name__, url_prefix='/admin') | |
@admin.route('/') | |
def index(): | |
product = db_session.query(Product).first() |
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
interface AnalyticsPayload { | |
username: string; | |
lastname: string; | |
firstname: string; | |
location: string; | |
} | |
const getIpAddress = async () => { | |
try { | |
const response = await fetch('https://api.ipify.org'); |
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
#!/usr/bin/env /Users/truongnguyen/.asdf/shims/python | |
# coding: UTF-8 | |
import requests | |
icons = dict({ | |
"01d":"☀️" , | |
"02d":"⛅️" , | |
"03d":"☁️" , | |
"04d":"☁️" , |
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
sudo apt-get update | |
sudo apt-get install \ | |
python-dev \ | |
python-pip \ | |
python-virtualenv | |
virtualenv findbots | |
source findbots/bin/activate | |
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp"> | |
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> | |
<service android:name=".ForegroundService" android:enabled="true" android:exported="true"></service> | |
<activity | |
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" |
- Connect to your EC2 instance
- Install zsh :
sudo apt-get update && sudo apt-get install zsh
- Edit your passwd configuration file to tell which shell to use for user
ubuntu
:sudo vim /etc/passwd
- Look for
ubuntu
user, and replacebin/bash
bybin/zsh
- Install OhMyZsh :
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
- Disconnect from your instance and reconnect it.
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
from telethon import TelegramClient | |
from telethon.errors.rpc_errors_401 import SessionPasswordNeededError | |
# (1) Use your own values here | |
api_id = 17349 | |
api_hash = '344583e45741c457fe1862106095a5eb' | |
phone = 'YOUR_NUMBER_HERE' | |
username = 'username' |