Categories
Microblog

A Trip Through New York (1911)

I find this video just remarkable. It’s only been 109 years and yet things are so much different now. I wonder what things will be like in a hundred more years. With any luck I’ll live to see.

Categories
Microblog

Orchid VPN

I have previously mentioned how I felt that Tor should offer some way for users to pay for bandwidth on its network to incentivize more nodes to join. Well, today I found out about Orchid which is a decentralized VPN that allows users to do just that.

It’s basically a marketplace for bandwidth between clients and VPN providers. Anyone can set up a node and act as exit point. From what I’ve read it seems like exit nodes can even choose what type of content will go through them: torrents, email, specific websites, etc. can all be blocked or allowed. The app will automatically pick providers that support the type of content that you’re trying to access.

Given this dynamic I would imagine that different types of content will start to cost more. For example, bandwidth providers who allow torrents will charge a premium due to the increased legal risk. On the other hand, providers who only allow access to known safe sites like YouTube, Reddit, etc. would be much cheaper.

Orchid even supports multiple hops within the network just like Tor. There are a few concerns I have:

  • Since it’s decentralized there is no way to ban exit nodes for logging peoples traffic
  • Everything is done in OXT which is Orchid’s native currency on Ethereum so it’s kinda a pain to pay for the service
  • Orchid uses its own VPN protocol not a standard one like OpenVPN or Wireguard.

For now, I’m going to continue using Private Internet Access as my VPN, but Orchid is something I’ll keep my eye on.

Categories
Microblog

Cloudron

Cloudron is fascinating piece of software I found out a few days ago. It makes it super easy to self-host a bunch of applications like Nextcloud, GitLab, Wallabag, etc.

They all have one-click installers and SSO with your Cloudron user accounts. Also, it supports encrypted backup to various cloud providers like Amazon S3, DigitalOcean Spaces, Google Cloud, etc.

The only two downsides I’ve found are that it costs $30/mo and isn’t FOSS.

I think I’m going to give it a try on a Linode server.

Categories
Microblog

Pamac > Pacman

I must say that I much prefer the Pamac CLI package manager to Pacman. It’s much more intuitive and I’m glad that Manjaro includes it by default.

Categories
Microblog

Arduino Pong

This is a simple pong game I created for fun for the CICS 290M Makerboard running Arduino software. The board is part of the CS Make course at UMass Amherst.

Below is the source code, it’s also available on GitHub.

// Imports
#include <Adafruit_SSD1306.h>

// Globals
#define UP_BUTTON 34
#define DOWN_BUTTON 0
#define RESET_BUTTON 35
#define BUZZER 17

// Game State
int score = 0;

// Paddle
int paddle_pos = 32;
int paddle_velocity = 1;
int paddle_height = 16;
int paddle_width = 4;

// Ball
volatile int ball_x = random(10, 80);
volatile int ball_y = random(16, 48);
volatile int ball_radius = 3;
volatile int ball_velocity_x = random(1, 3);
volatile int ball_velocity_y = random(1, 3);


Adafruit_SSD1306 lcd(128, 64); // create display object

// Callbacks
void IRAM_ATTR moveUp() {
  if (paddle_pos >= 0) {
    paddle_pos -= 1;
  }
}

void IRAM_ATTR moveDown() {
  if (paddle_pos + paddle_height <= 64) {
    paddle_pos += 1;
  }
}

void IRAM_ATTR restart() {
  if (gameOver()) {
    score = 0;
    ball_x = random(10, 80);
    ball_y = random(16, 48);
    ball_velocity_x = random(1, 3);
    ball_velocity_y = random(1, 3);
  }
}
void setup() {
  Serial.begin(9600);
  pinMode(BUZZER, OUTPUT);
  pinMode(UP_BUTTON, INPUT);
  pinMode(DOWN_BUTTON, INPUT);
  pinMode(RESET_BUTTON, INPUT);
  lcd.begin(SSD1306_SWITCHCAPVCC, 0x3C); // init
  lcd.setTextColor(WHITE);
  lcd.clearDisplay(); // clear software buffer
  lcd.display();
  attachInterrupt(RESET_BUTTON, restart, FALLING);
}

// Test if coordinates are out of bounds
boolean yIsOutOfBounds(int y) {return y > 63 || y < 0;}
boolean xIsOutOfBounds(int x) {return x > 127 || x < 0;}
boolean outOfBounds(int x, int y) {return xIsOutOfBounds(x) || yIsOutOfBounds(y);}
boolean gameOver() {return ball_x + ball_radius >= 127;}
boolean ballPaddleCollision(int x, int y) {
  return (x > 128 - paddle_width) && (y < paddle_pos + paddle_height && y > paddle_pos);
}

void drawPaddle(int x, int y, int width, int height) {
  lcd.fillRect(x, y, width, height, WHITE);
}

void ding() {
  ledcSetup(0, 5000, 8);
  ledcAttachPin(BUZZER, 0);
  ledcWriteTone(0, 500);
  delay(50); // 500Hz for 0.05 second
  ledcWriteTone(0, 0); // buzzer off
}

void drawBall() {
  lcd.fillCircle(ball_x, ball_y, ball_radius, BLACK);
  if (xIsOutOfBounds(ball_x + ball_radius) || xIsOutOfBounds(ball_x - ball_radius)) {
    ball_velocity_x *= -1;
    ding();
  }
  if (yIsOutOfBounds(ball_y + ball_radius) || yIsOutOfBounds(ball_y - ball_radius)) {ball_velocity_y *= -1;}
  if (ballPaddleCollision(ball_x + ball_radius, ball_y) || ballPaddleCollision(ball_x - ball_radius, ball_y)) {
    ball_velocity_x *= -1;
    ding();
    score++;
  }
  ball_x += ball_velocity_x;
  ball_y += ball_velocity_y;
  lcd.fillCircle(ball_x, ball_y, ball_radius, WHITE);
}

void loop() {
  // Check if Game is over
  if (gameOver()) {
    lcd.clearDisplay();
    lcd.setCursor(0,0);
    lcd.print("Score: " + String(score) + "\nPress bottom button \nto restart.");
    lcd.display();
    return;
  }
  // Check for button presses
  if (!digitalRead(UP_BUTTON)) {
    moveUp();
  }
  if (!digitalRead(DOWN_BUTTON)) {
    moveDown();
  }
  lcd.clearDisplay();
  drawPaddle(0, ball_y - (paddle_height / 2), paddle_width, paddle_height);
  drawPaddle(127 - paddle_width, paddle_pos + paddle_velocity, paddle_width, paddle_height); 
  drawBall();
  lcd.display();
}
Categories
Microblog

Signal Foundation Donation

I’ve decided to set up a monthly donation to the Signal Foundation. I’m not the biggest fan of Signal and I’ve been critical of the fact that it relies on central servers that can be shut off at any time.

But none of the peer-to-peer apps I’ve tried (such as Tox) seem competitive in this space. I need something I can give a non-technical friend and not have them feel like its a downgrade from WhatsApp.

For now I’m going to stick with Signal but I’ll keep an eye on some other promising projects like Matrix.

Categories
Microblog

Switching to Krita from GIMP

I’ve been using GIMP for the last couple of years, but since I’m on KDE Plasma I decided to give Krita a try.

It’s actually very capable and I’m going to try using it in lieu of GIMP for a little while.

Categories
Microblog

2020 Recession

There seems to have been lots of talk of an impending stock market crash recently. Some people seem to be absolutely certain of it for reasons such as the inverted yield curve, high PE multiples, and the trade war with China. I’ve even heard people talk about the “2020 recession” as if it has already happened.

Personally, I’m skeptical. I don’t think there is any greater risk of a market downturn today then there was 5 years ago. Everyone knows that the yield curve has inverted and that inversions have historically preceded recessions in the United States. But the expectation of an upcoming recession is already priced into the market.

Similarly, the risks associated with the Chinese trade war have also been priced in.

Now I’m not saying that there won’t be a market crash, but I am saying that if there is one the cause will be something that is not currently priced into the market (in other words, something that isn’t receiving 24/7 news coverage).

Categories
Microblog

Debian 10 “buster” is released!

Debian 10 “buster” is released!

Categories
Microblog

Charlie Munger interview

I always appreciate Charlie Munger’s bluntness in his interviews. It’s quite the contrast to Warren.