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
#!/bin/bash | |
# Installs CodeDeploy agent and its prerequisites on Ubuntu 22.04 given AWS CodeDeploy team doesn't exist | |
# https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent.html#codedeploy-agent-version-history | |
CODEDEPLOY_VERSION=1.4.1-2244 | |
sudo apt update | |
sudo apt install ruby-full ruby-webrick wget -y | |
cd /tmp |
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
cheatsheet do | |
title 'VSCode snippets' # Will be displayed by Dash in the docset list | |
docset_file_name 'VSCode-snippets' # Used for the filename of the docset | |
keyword 'typescript' # Used as the initial search keyword (listed in Preferences > Docsets) | |
# resources 'resources_dir' # An optional resources folder which can contain images or anything else | |
introduction 'Snippet shortcuts for vscode' # Optional, can contain Markdown or HTML | |
# https://github.com/accierro/react-typescript-snippets | |
category do |
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
select pid, | |
usename, | |
pg_blocking_pids(pid) as blocked_by, | |
query as blocked_query | |
from pg_stat_activity | |
where cardinality(pg_blocking_pids(pid)) > 0; |
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
# Webpack loader: manifest.json map generated by webpacker | |
manifest = orjson.loads(open(f'{app.static_folder}/dist/manifest.json').read()) | |
def webpack(pack): | |
filename = 'bundle.js' if app.config['ENV'] == 'development' else manifest.get(pack) | |
return f'{app.static_url_path}/dist/{filename}' | |
app.jinja_env.globals.update(webpack=webpack) | |
# Use in template <script src="{{ webpack('main.js') }}"></script> |
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 django.core import signing | |
from django.conf import settings | |
from django.utils.module_loading import import_string | |
session_data = 'xxxxxxx' | |
settings.configure(SECRET_KEY = 'XXXX') | |
signing.loads( | |
session_data, | |
salt="django.contrib.sessions.SessionStore", |
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
require 'aws-sdk-s3' | |
require 'concurrent' | |
source_bucket = 'xxx' | |
dest_bucket = 'xxx' | |
acl = 'public-read' | |
client = Aws::S3::Client.new( | |
region: 'ap-southeast-2', |
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
export $(cat /opt/elasticbeanstalk/deployment/env | xargs) |
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
DROP TABLE IF EXISTS requests; | |
CREATE TABLE requests ( | |
request_date Date, | |
request_time DateTime, | |
response_time Int, | |
request_uri String) | |
ENGINE = MergeTree(request_date, (request_time, request_uri), 8192); | |
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
pip3 install xkeysnail | |
sudo xkeysnail linux-map-key-remap.py | |
ln -s ~/xkeysnail.service /etc/systemd/system/xkeysnail.service | |
sudo systemctl enable xkeysnail |
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
<Zone zones={[ | |
{ | |
id: 'pre', | |
start: { hours: 4, minutes: 0, seconds: 0 }, | |
end: { hours: 9, minutes: 30, seconds: 0 }, | |
fill: "#999999", | |
opacity: 0.1, | |
startLine: { | |
stroke: '#3d7cd4', | |
strokeWidth: 1, |
NewerOlder