Skip to content

Instantly share code, notes, and snippets.

View rogerhendricks's full-sized avatar

Roger Hendricks rogerhendricks

  • Sydney Australia
View GitHub Profile
# Endpoint providing CSV of listed companies and their tickers
asx_companies_csv: https://www.asx.com.au/asx/research/ASXListedCompanies.csv
# Endpoint providing XLS spreadsheet of all listed securities and their tickers
asx_securities_tsv: https://www.asx.com.au/programs/ISIN.xls
# NOTE the extension is xls but the file is actuall tab separated
# Endpoint to pull individual companies data
asx_company_json: https://www.asx.com.au/asx/1/company/%s?fields=primary_share,latest_annual_reports,last_dividend,primary_share.indices
# %s = ticker
sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
sudo sh -c 'rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf'
sudo systemctl restart systemd-resolved
@rogerhendricks
rogerhendricks / install_swift.md
Created June 19, 2023 01:40
install swift language on ubuntu 22.04 LTS

Installing Swift on Ubuntu 22.04

1. Install Depencies

“clang”[ˈklæŋ] is the compiler based on LLVM for C, C++, Objective-C, and Objective-C++. clang is needed to install in order to Swift. Run the following code in Ubuntu terminal.

Before installing swift “libpython2.7” and “libpython2.7-dev” are needed to get Swift running. Run the following code.

@rogerhendricks
rogerhendricks / README.md
Created March 31, 2023 11:21 — forked from lucianoratamero/README.md
Using Vite with Django, the simple way

Using Vite with Django, the simple way

Warning

I'm surely not maintaining this as well as I could. There are also other possible, better integrated solutions, like django-vite, so keep in mind this was supposed to be more of a note to myself than anything :]

This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.

Here's a boilerplate that uses this approach: https://github.com/labcodes/django-react-boilerplate

A couple of things to note:

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
rbenv install -v 2.3.1
rbenv global 2.3.1
@rogerhendricks
rogerhendricks / gist:a52bca78b755d9641e8eb3bdc75d9d7e
Created November 25, 2021 20:04
Moodle Docker-compose file
version: '2'
services:
mariadb:
image: mariadb
volumes:
- /srv/Configs/Databases/Moodle:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=moodle
- MYSQL_ROOT_USER=root
- MYSQL_DATABASE=moodle
reset admin password in docker container.
sudo docker exec -it -u 33 nextcloud_app_1 php /var/www/html/occ user:resetpassword admin
@rogerhendricks
rogerhendricks / generate-ssh-key.sh
Last active February 2, 2025 08:45 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@rogerhendricks
rogerhendricks / postgresql_cheatsheet.md
Last active February 27, 2020 00:09
postgresql cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)