Install postgresql-9.4
$ sudo apt-get install postgresql-9.4
Then psql version should be 9.4.x
$ psql --version
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list or create /etc/apt/sources.list.d/pgdg.list and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
Then import the repository signing key, and update the package lists:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get updateInstall a new version of PostgreSQL server.
Once the Debian upgrade finished, I used dpkg-query -l postgresql* to check which versions of postgres I have installed.
| # ------------------------------------------------ | |
| # Config files are located in /etc/wireguard/wg0 | |
| # ------------------------------------------------ | |
| # ---------- Server Config ---------- | |
| [Interface] | |
| Address = 10.10.0.1/24 # IPV4 CIDR | |
| Address = fd86:ea04:1111::1/64 # IPV6 CIDR | |
| PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started | |
| PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown |
| cmake_minimum_required(VERSION 3.17) | |
| project(foo) | |
| set(CMAKE_CXX_STANDARD 20) | |
| set(LIBPROC_SRC "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libproc.h") | |
| set(CMAKE_AUTOMOC ON) | |
| set(CMAKE_AUTOUIC ON) |
| set WshShell = WScript.CreateObject("WScript.Shell") | |
| WScript.Sleep 3000 | |
| 'Hackery to get the clipboard's contents | |
| Set objHTML = CreateObject("htmlfile") | |
| text = objHTML.ParentWindow.ClipboardData.GetData("text") | |
| WshShell.SendKeys text |
| #include "master_i2c.h" | |
| #include <driver/i2c.h> | |
| #include <esp_log.h> | |
| #include <freertos/FreeRTOS.h> | |
| #define ACK_CHECK_EN 0x1 //!< I2C master will check ack from slave | |
| #define ACK_CHECK_DIS 0x0 //!< I2C master will not check ack from slave | |
| static SemaphoreHandle_t i2c_semaphore = NULL; |
The TP Link Kasa smart switches log energy consumption data over time, however the app is very limited and won't let you get out data, graph it or see historical usage. This script extracts and saves to a CSV file.
The python-kasa library is used to communicate with the Kasa switch.
| CDROM=/dev/rdisk4 # on macOS: need to specify raw disc device for cdparanoia to work | |
| # Use `diskutil list` to find right device | |
| OUTPUTTYPE="flac,m4a" | |
| ACTIONS=cddb,read,getalbumart,encode,tag,embedalbumart,move,clean | |
| # === Output location and file naming === | |
| OUTPUTDIR="$HOME/Music/CDRips" | |
| OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}. ${TRACKFILE}' |