created: 2022-08-21 updated: 2022-08-21

Introduction

My mind is a collection of unorganized and unexamined thoughts, writing bring orders and insights to chaos and unknown. Along the way, I become closer to myself.

Tools


created: 2022-08-22 updated: 2022-09-10

Programming

Doing

I'm working through Elements of Programming Interviews.

I'm starting to see some patterns with problems, which is a good thing.

I've been procrastinating for a few months now.

My github repo: here

VSCode

Shift + Alt + O to organize imports.

Sublime Text 4

Alt + Left Click to collapse sidebar folder.

Deploy sub directory to Heroku

git subtree push --prefix part3/phonebook-backend heroku main

Lessons

I stayed up late one night to set up Firebase App Check for my personal project. I got it working with Cloud Functions but the token wasn't passed to FireStore. I read the documents multiple times, checked my code to make sure that it was set up correctly and everything was the same as the provided example.

I went to bed and first thing in the morning, I looked through the settings again and saw this.

No support yet

I couldn't believe I missed that big orange warning section.

Staying up late reduces my productivity and mental capacity. I didn't realize how my mind was trapped in a tunnel vision.

Libraries to use for quick prototype

Front end

@import url("https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css");
@import url("https://unpkg.com/sakura.css/css/sakura-ink.css");

Back end

npx json-server -p3001 --watch db.json

Look into

postgresql -> rest

https://github.com/PostgREST/postgrest

https://github.com/graphile/postgraphile


created: 2022-08-21 updated: 2022-08-21

Raspberry

Change password to password

Edit /etc/shadow on SD card, change the hashed password to $1$salt$qJH7.N4xYta3aEG/dfqo/0. The new password is password.


References


Tags

Bash

Special characters in file names

- is recognized as stdin, so use ./- for checking filenames beginning with -.

Use "hello world" when names contain spaces.

IO redirection

Note: Basic file descriptor (fd) for shell's operation are 0 for STDIN, 1 for STDOUT, 2 for STDERR.

I used this code for OverTheWire Bandit 25.

#!/bin/bash

# Link fd3 to localhost:30002 bidirectional
exec 3<>/dev/tcp/localhost/30002
# Print out first line from fd3
head -1 <&3

old_password="UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ"

for i in {0000..9999}
do
    answer="${old_password} ${i}"
    # Send to fd3
    echo $answer >&3
    response=$(head -1 <&3)
    if ! [[ $response =~ "Wrong" ]]
    then
        echo $i
        break
    fi
done

# Reset fd3 to normal
exec 3>&-

netcat

Use nc to create a server/client to send tcp.

# Server
nc -l 1234
# Client
nc localhost 1234

git

Generate a new SSH key.

ssh-keygen -t ed25519 -C "[email protected]"

Add key to ssh-agent.

ssh-add ~/.ssh/id_ed25519

Python

Bitwise

Positive numbers have leading 0, negative numbers have leading 1.

# TODO think about this, don't understand why atm
-x = complement(x-1)

Function

A function either returns something or mutate arguments. Probably put 'mutate' in docstring just in case.

React

npx create-react-app some-app

Ref: github bug

I'm using Win 10 and the username has a space (V L).

C:\Users> dir /x    # got VL~1

npm config edit and add cache=C:\Users\VL~1\AppData\Roaming\npm-cache to config file.

Audit vulnerabilities

open issue

Move react-scripts from dependencies to devDependencies in package.json, then run npm audit --production.

Java

Install OpenJDK

Use https://adoptopenjdk.net/ to install on Windows.

JS

Backwards & Forwards

JS is backward-compatible. Developers can write code which won't stop running when browsers are updated.

Transpiler

Developers can write JS with new syntax then use a transpiler (Babel is a popular choice) to convert the source code to older JS version.

Example: let is coverted to var.

Polyfill

Developers can work with recently added API methods, then use polyfill to provide the missing methods for older browsers.

Number

Number type is double precision 64-bit, which consists of numbers between -(2^53-1) and +(2^53-1) inclusive (± 9,007,199,254,740,991). So any integer is implicitly a float.

Integers are treated as 32-bit int until they are used to perform an instruction that is valid on a Number but not on 32-bit int.

// check if a number is an integer
Number.isSafeInteger(12)          // true
Number.isSafeInteger(12.0)        // true
Number.isSafeInteger(12.1)        // false
Number.isSafeInteger(NaN)         // false
Number.isSafeInteger(Infinity)    // false
Number.isSafeInteger('12')        // false

Custom object

function Person(first, last) {
  this.fist = fist
  this.last = last
}

// fullname shared by all Person instances
Person.prototype.fullname = function() {
  return this.first + this.last 
}

Comparisons

=== is described as 'checking both the value and the type', which is correct most of the time.

// true
3 === 3.0
'abc' === 'abc'
null === null
true === true

// false
3 === '3'
'a' === 'A'
0 === null

2 special cases:

NaN === NaN     // false
0 === -0        // true

For NaN, use Number.isNaN(...). For -0, use Object.is(...).

As for non-primitives, === compares references.

const x = [1, 2, 3]
const y = x

x === y           // true
y === [1, 2, 3]   // false
x === [1, 2, 3]   // false

this

this value is dynamic and depends on the execution context.

const say = function() {
  console.log(`Hi ${this.word}`)
}

this points to global object window.

// Hi undefined
say()

this refers to the object that execute the function.

const test = {
  word: 'Testing',
  say: say,
}

// Hi Testing
test.say()

Can also use apply to bind this to an object.

const test2 = {
  word: 'Another test',
}

// Hi Another test
say.apply(test2)

Prototypes


created: 2022-08-15 updated: 2022-08-18

.NET

Decompile

CancellationToken

Use token to cancel long-running tasks.

CancellationTokenSource tokenSource = new();

try
{
    await httpClient.GetAsync("http://someApi/endpoint", tokenSource.Token)
}
catch (TokenCancellationException ex)
{
    logger.LogInformation(ex, "token cancelled");
}
catch (Exception ex)
{
    throw;
}

Tags


created: 2022-08-11 updated: 2022-09-10

Setup Windows 10

Debloat

iwr -useb https://git.io/debloat|iex

Scoop

I use scoop to install most of my software. I disable auto update in the software and will only update using scoop command.

Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb get.scoop.sh | iex

Local

scoop install 7zip git sumatrapdf mpc-hc-fork bulk-crap-uninstaller freedownloadmanager aria2

scoop install sublime-text
reg import C:\Users\V\scoop\apps\sublime-text\current\install-context.reg

scoop install vscode
reg import C:\Users\V\scoop\apps\vscode\current\vscode-install-context.reg

scoop install python
reg import C:\Users\V\scoop\apps\python\current\install-pep-514.reg

scoop install cmder mdbook nodejs-ltd hxd adb ueli anaconda3
scoop install keepassxc anki winscp eartrumpet deepl sharex calibre dotnet-sdk

Firefox

Tree Style Tabs

Solution to hide horizon tabs from Superuser.

  1. Toggle toolkit.legacyUserProfileCustomizations.stylesheets in about:config to true.
  2. Open Folder for profile in about:support.
  3. touch chrome/userChrome.css
  4. Inside userChrome.css:
#TabsToolbar {
  visibility: collapse;
}

#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
  visibility: collapse !important;
}
  1. Enable Title Bar in Customize Toolbar...
  2. Restart Firefox.

Leetcode

Max area

/**
 * @param {number[]} height
 * @return {number}
 */
const maxArea = (height) => {
  let left = 0
  let right = height.length - 1
  let area = 0

  while (left < right) {
    area = Math.max(
      area,
      Math.min(height[left], height[right]) * (right - left),
    )

    if (height[left] < height[right]) {
      left += 1
    } else if (height[left] > height[right]) {
      right -= 1
    } else {
      left += 1
      right -= 1
    }
  }

  return area
}

2 pointers at the start and end of the array give us the widest container. As the area is constrained by the shorter line, moving the pointer at the shorter height will reduce the width but possibly increase the height, hence bigger area.

O(n) time as 1 pass, O(1) space.

Contains duplicates

/**
 * @param {number[]} nums
 * @return {boolean}
 */
const containsDuplicate = (nums) => {
  const uniqueNums = new Set()

  for (let num of nums) {
    if (uniqueNums.has(num)) {
      return true
    }
    uniqueNums.add(num)
  }

  return false
};

I was using {} as a dictionary to keep track of unique numbers, and forgot about set.

O(n) time as 1 pass, O(n) space.

Max subarray

/**
 * @param {number[]} nums
 * @return {number}
 */
const maxSubArray = (nums) => {
  let currMax = 0
  let maxTillNow = -Infinity

  for (let num of nums) {
    currMax = Math.max(num, currMax + num)
    maxTillNow = Math.max(maxTillNow, currMax)
  } 

  return maxTillNow 
}

currMax holds the max subarray total at index i. At every index, check if max total at index i-1 + nums[i] is higher than nums[i]. maxTillNow keeps track of the max we have seen so far.

I only knew of this elegant solution by checking the answers.

O(n) time and O(1) space.

Buy and sell stock 1

/**
 * @param {number[]} prices
 * @return {number}
 */
const maxProfit = (prices) => {
  let lowestPrice = +Infinity
  let maxProfitSeen = 0

  for (let price of prices) {
    maxProfitSeen = Math.max(maxProfitSeen, price - lowestPrice)
    lowestPrice = Math.min(lowestPrice, price)
  }

  return maxProfitSeen
}

Keep track of the lowest price seen, and calculate the max profit if sold every day with the lowest price.

O(n) time and O(1) space.

2Sum

/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number[]}
 */
const twoSum = (nums, target) => {
  const memo = new Map()

  for (let i = 0; i < nums.length; i++) {
    const toFind = target - nums[i]

    if (memo.has(toFind)) {
        return [i, memo.get(toFind)]
    }

    memo.set(nums[i], i)
  }

  return []
}

Use a map to to save the number and its index to speed up looking up. O(n) time and O(n) space.

3Sum

/**
* @param {number[]} nums
* @return {number[][]}
*/
const threeSum = (nums) => {
const res = []

nums.sort((a,b) => a - b)

for (let i = 0; i < nums.length - 2; i++) {
  // first num is positive, can't sum to 0
  if (nums[i] > 0) break;

  // skip duplicates nums[i]
  if (i !== 0 && nums[i] === nums[i-1]) {
    continue;
  }

  let j = i + 1
  let k = nums.length - 1

  while (j < k) {
    if (nums[i] + nums[j] + nums[k] === 0) {
      res.push([nums[i], nums[j], nums[k]])
      j += 1
      k -= 1

      // skip duplicates nums[j]
      while (j < k && nums[j] === nums[j-1]) {
          j += 1
      }
      // skip duplicates nums[k]
      while (j < k && nums[k] === nums[k+1]) {
          k -= 1
      }
    } else if (nums[i] + nums[j] + nums[k] > 0) {
      k -= 1
    } else {
      j += 1
    }
  }
}
return res
}

Sorted the array. Calculate the sum, if the sum is positive, decrease the sum by moving right index (k) to the left. If the sum is negative, increase the sum by moving left index (j) to the right.

O(n^2) time, O(n) space.


created: 2022-08-21 updated: 2022-08-21

Low code

Impressions

I used a low code framework in my previous job and the development experience was horrible.

  • It's easy to build MVC, but it is a lot harder to go beyond that. If a feature wasn't supported by the framework, we could add it via JavaScript in theory, but it was hell doing so.
  • It isn't scalable. Low code becomes code the form of visual boxes in lieu of written texts. As more features were added, it became harder to read and refactor.
  • Vendor lock-in.
    • There is no way to export apps to normal code and transition to another framework. The only way out is to develop from scratch.
    • No 3rd party performance profiler. Had to ask vendor to come in person, so they can run their propriety profiler in the office. The app was running slow, but we couldn't figure why without the help of vendor.
    • Vendor version control or the lack of version control. It was difficult for multiple devs to work on the same file. Changes were overwritten, and the merging/diff tools were inadequate.
  • Lack of community. The forum was inactive, there was no Stack Overflow for the framework.
  • Low supply of developers who want to work in low code, which I can hardly blame them for. The low code is code, so we needed developers. Non programmers couldn't improve or fix the app due to the complexity of business and programming logic; if they could, they became software engineers and got a better job else where.

References


Tags

Unit test

They can be tedious when a method doesn't contain logics, and it's mainly calling other methods.

public void DoSomething(User user)
{
    try
    {
        _dbLibrary.Update(user);
        _emailLibrary.Email(user.email, "DONE");
        _logLibrary.Log("SUCCEED");
    }
    catch (Exception ex)
    {
        HandleException(user);
        _logLibrary.Log(ex, "FAILED");
    }
}

I can mock the 3rd party library, checking that passed parameters are correct. I can set up the mock methods to throw an exception to test the codes inside catch clause.

In the example above, I think an integration test might be better.

Server

VPS, AWS...

Ansible

Updated: November 27 2018

Why

I bought OVH VPS at half price during Black Friday.

For the past few years, I ssh into the server and used the command to pull Docker images and config files from a git repo. This year, I tested out Ansible to automate setting up the VPS. The learning curve wasn't too bad but I did run into a few problems here and there.

New user

This role starts firewall with ssh port, creates a new user for ssh and remove root ssh login.

---
- name: install unattended upgrade
  apt:
    name: "{{ item }}"
  loop:
    - unattended-upgrades
    - fail2ban

- name: unattended upgrade config
  template:
    src: 10periodic.j2
    dest: /etc/apt/apt.conf.d/10periodic
    owner: root
    group: root
    mode: 0644

- name: start ufw with port 22
  ufw:
    state: enabled
    rule: allow
    port: 22

- name: Add a new user
  user:
    name: "{{ user_name }}"
    groups: sudo
    append: yes
    shell: /bin/bash
    password: "{{ user_password }}"

- name: Add ssh key
  authorized_key:
    user: "{{ user_name }}"
    key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"

- name: Setup ssh config
  lineinfile:
    path: /etc/ssh/sshd_config
    regexp: "{{ item.regexp }}"
    line: "{{ item.line }}"
  loop:
    - regexp: '^PasswordAuthentication'
      line: 'PasswordAuthentication no'
    - regexp: '^PermitRootLogin'
      line: 'PermitRootLogin no'
  notify:
    - restart ssh

Secure VPS

This makes the server more secure and email me daily report. It's pretty crazy how many ssh attempts my new VPS gets everyday.

---
- name: install postfix, fail2ban and logwatch
  apt:
    name: "{{ item }}"
    update_cache: yes
  loop:
    - unattended-upgrades
    - postfix
    - logwatch
    - fail2ban

- name: unattended upgrade config
  template:
    src: 10periodic.j2
    dest: /etc/apt/apt.conf.d/10periodic
    owner: root
    group: root
    mode: 0644

- name: Create fail2ban config
  template:
    src: jail.local.j2
    dest: /etc/fail2ban/jail.local
    owner: root
    group: root
    mode: 0644
  notify:
    - restart fail2ban

- name: Create postfix conf
  template:
    src: main.cf.j2
    dest: "{{ postfix_conf_dir }}/main.cf"
    owner: root
    group: root
    mode: 0644

- name: Create sasl password file
  template:
    src: mailgun.j2
    dest: "{{ postfix_conf_dir }}/mailgun"
    owner: root
    group: root
    mode: 0600

- name: Update postfix table
  command: postmap "{{ postfix_conf_dir }}/mailgun"
  notify:
    - restart postfix

- name: Setup logwatch cron
  lineinfile:
    path: /etc/cron.daily/00logwatch
    regexp: "^/usr/sbin/logwatch"
    line: "/usr/sbin/logwatch --mailto {{ my_email }} --detail high"

docker

I use gitlab to host some docker images. I utilise private repo to build docker images with sensitive data. I'm not sure it's a good idea to keep username, password and api key inside images. Would it be better to expose those via env variables?

---
- name: Install packages
  apt:
    name: "{{ item }}"
    update_cache: yes
  loop:
    - apt-transport-https
    - ca-certificates
    - python3-pip

- name: Add Docker's GPG key
  apt_key:
    url: https://download.docker.com/linux/ubuntu/gpg
    id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88

- name: Add Docker repo
  apt_repository:
    repo: "{{ docker_apt_repo }}"

- name: Install docker
  apt:
    name: docker-ce

- name: Install docker compose
  get_url:
    url: "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-Linux-x86_64"
    dest: /usr/local/bin/docker-compose
    mode: 0755

- name: Install docker and docker-compose pip
  pip:
    name: "{{ item }}"
  loop:
    - docker
    - docker-compose

- name: Add docker group
  group:
    name: docker

- name: Add user to docker group
  user:
    name: "{{ user_name }}"
    groups: docker
    append: yes
  notify:
    - reboot

- name: Log into gitlab docker repo
  docker_login:
    registry: registry.gitlab.com
    username: "{{ gitlab_username }}"
    password: "{{ gitlab_password }}"
    config_path: "/home/{{ user_name }}/.docker/config.json"

- name: Copy docker-compose.yml to remote
  template:
    src: docker-compose.yml.j2
    dest: "/home/{{ user_name }}/docker-compose.yml"
    owner: "{{ user_name }}"
    group: "{{ user_name }}"

- name: Start docker compose
  become: false
  docker_service:
    project_src: "/home/{{ user_name }}"

VPN

---
- name: Add wireguard ppa
  apt_repository:
    repo: "ppa:wireguard/wireguard"

- name: Install wireguard
  apt:
    name: wireguard

- name: Allow forwarding
  lineinfile:
    path: /etc/sysctl.conf
    regexp: "{{ item.regexp }}"
    line: "{{item.line }}"
  loop:
    - regexp: '^#net.ipv4.ip_forward'
      line: 'net.ipv4.ip_forward=1'
    - regexp: '^#net.ipv6.conf.all.forwarding'
      line: 'net.ipv6.conf.all.forwarding=1'
  notify:
    - restart sysctl

- name: Open ufw port
  ufw:
    state: enabled
    rule: allow
    port: "{{ wg_port }}"

- name: Create wg config
  template:
    src: wg.conf.j2
    dest: "{{ wg_config_dir }}/wg.conf"
    owner: root
    group: root
    mode: 0600

- name: Start wg
  service:
    name: [email protected]
    state: started
    enabled: yes

- name: Allow ovh ipv6
  template:
    src: 50-cloud-init.yaml.j2
    dest: "{{ netplan_config_dir }}/50-cloud-init.yaml"
    owner: root
    group: root
    mode: 0644
  when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18")
  notify:
    - restart netplan

Wireguard VPN

Updated: December 7 2018

Why

I have always wanted to setup my own VPN for privacy reasons. It's a long overdue personal project.

Staying in a hotel, their wifi is way too slow. So I have been relying on my phone tether for internet access. It's interesting that phone hotspot blocked connection to Steam so I couldn't update some of my games. Hence, VPN seems like a good choice.

Wireguard

I came across wireguard while researching OpenVPN. It's an up-and-coming VPN, which advertised to be more performant and simpler than OpenVPN.

Server

I utilise my ovh vps to run VPN. I did run into a problem where I couldn't redirect ipv6 traffic through my server. It turned out that ovh hadn't setup IPv6 by default.

For Ubuntu 18.04, netplan was used by default so I needed to modify /etc/netplan/50-cloud-init.yaml

network:
    version: 2
    ethernets:
        ens3:
            dhcp4: true
            match:
                macaddress: {{ server_mac }}
            set-name: ens3
            addresses:
                    - {{ server_ipv6 }}/64
            gateway6: {{ server_gateway }}

install wireguard

The package isn't in Ubuntu repo so I need to add its ppa.

sudo add-apt-repository ppa:wireguard/wireguard
sudo apt-get update
sudo apt-get install wireguard

allow forwarding traffic

In /etc/sysctl.conf, uncomment net.ipv4.ip_forward=1 and net.ipv6.conf.all.forwarding=1. Then run the command sudo sysctl -p.

open port

# a random closed port
sudo ufw allow 12345

generate keys

Creating 2 public and private key files only readable by root:

umask 077
wg genkey | tee privatekey | wg pubkey > publickey

config

#/etc/wireguard/wg0.conf
[Interface]
# ip used to identify between different peers
Address = 192.168.2.1/32, fd86:ea04:1115::1/128
# iptable config to redirect all traffic
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -$
# delete iptable config when wireguard stops
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING$
# port wireguard running on
ListenPort = 12345
PrivateKey = <server privatekey>
SaveConfig = true

Client

Install wireguard and generate keys following the exact same steps as server. Below is my config for wireguard in client:

#/etc/wireguard/wg0-client.conf
[Interface]
Address = 192.168.2.2/32, fd86:ea04:1115::2/128
PrivateKey = <client privatekey>

[Peer]
PublicKey = <server publickey>
# allow all ip
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = <server ip>:12345
PersistentKeepalive = 25

Now, append to server's /etc/wireguard/wg0.conf

[Peer]
PublicKey = <client publickey>
AllowedIPs = 192.168.2.2/32, fd86:ea04:1115::2/128

Start VPN

# server
sudo wg-quick up wg0
# client
sudo wg-quick up wg0-client

If everything is working fine, sudo wg will show handshake.

To auto start wireguard on boot, do systemctl enable [email protected] on server.

Phone

qrencode -t ansiutf8 < wg0-client.conf creates a qr image to import the config to phone app. I also installed an app to share vpn with other devices.

Testing

I tested the connection with https://test-ipv6.com/, everything work fine with laptop client. But on phone, real IPv6 showed up on the website. At the moment, I'm unsure how to fix it.

Since I used my phone for tether, I could block IPv6 on laptop and no website would be able to tell my real IP. So leaking IPv6 is not really a major concern for now.

Projects

A few personal projects.

TODO: update broken links.

TDD

TODO: update insecure dependencies

source code | website

Practicing TDD while reading TDD with Python.

GraphQL example

source code | [writeup]({{ site.baseurl }}{% post_url 2016-09-18-a-simple-graphql-example %}) | website

Really basic GraphQL example, built on SQLite3 and Nodejs.

Full Stack open 2022

It took me 10 months to complete 9 parts of the course, which was longer than I expected. During the same time span, I got a new job and moved to a new place.

I highly recommend this course as an introduction to web development.

RickdiculouslyEasy: 1 CTF

Updated: August 4 2018

Setup

I used Ubuntu server 18.04 as a base for my VM guest OS. I SSHed from the host OS to Ubuntu server VM; from here I tried to break into RickdiculouslyEasy VM.

It would be more convinient to attack the vulnerable vm directly from host os but going through an intermediate vm seems safer. I could create checkpoints to rollback if necessary. My data in host was seperate from vulnerable vm, which might corrupt them. You can never be too careful.

IP

RickdiculouslyEasy VM ip was 192.168.56.101. I could do a ping sweep over host addresses to find the ip of all local VM

nmap -v -sn 192.168.56.1/24

nmap

Ran nmap against 192.168.56.101 to find all open ports.

# T4: faster scan; T5 is too aggressive
# -Pn: skip host discovery, treats all hosts as live
# -p-: all ports
# -sV: find which services are currently running on found open ports
$ sudo nmap -T4 -v -Pn -p- -sV 192.168.56.101

PORT      STATE SERVICE VERSION
21/tcp    open  ftp     vsftpd 3.0.3
22/tcp    open  ssh?
80/tcp    open  http    Apache httpd 2.4.27 ((Fedora))
9090/tcp  open  http    Cockpit web service
13337/tcp open  unknown
22222/tcp open  ssh     OpenSSH 7.5 (protocol 2.0)
60000/tcp open  unknown

ftp

nmap -sC showed that fpt can be signed in without password. Inside, I got 1st flag FLAG{Whoa this is unexpected} - 10 Points

cockpit

192.168.56.101:9090 gave FLAG {There is no Zeus, in your face!} - 10 Points. The login page was broken so there was nothing else to do here.

nc

192.168.56.101:13337 gave FLAG:{TheyFoundMyBackDoorMorty}-10Points.

192.168.56.101:60000 provided a hint that it's a shell. Used nc to connect and there was a flag file inside FLAG{Flip the pickle Morty!} - 10 Points.

:80

192.168.56.101:80 was just a normal page. 192.168.56.101:80/robots.txt gaves links to 3 other webpages The most important link among them is 192.168.56.101:80/cgi-bin/tracertool.cgi. A quick test showed that linux commands can be injected into cgi script. 192.168.56.101; ls -al lists all files in current dir.

Tried some ls -al, cd and pwd led me to another flag file. FLAG{Yeah d- just don't do it.} - 10 Points

I also found passwords.html which hid winter password in the html comments.

192.168.56.101; ls -al /etc; more /etc/passwd gave the list of all users.

ssh

Port 22 seemed like a fake ssh port while port 22222 is the actual ssh port.

Tried winter password with all found users and it was Summer's. Inside Summer's home dir, I got another flag. FLAG{Get off the high road Summer!} - 10 Points

Accessed /home/Morty, there were 2 files, an image and a password-protected zip file. Opening the image with vim, I saw the zip password Meeseek. unzip -c journal.txt.zip gave FLAG: {131333} - 20 Points

Inside /home/RickSanchez, there is a binary file safe which can be read by all but only executed by RickSanchez. cp safe /home/Summer/ copied the file and the new file is owned by Summer.

$ ./safe 131333
decrypt:    FLAG{And Awwwaaaaayyyy we Go!} - 20 Points

Ricks password hints:
 (This is incase I forget.. I just hope I don't forget how to write a script to generate potential passwords. Also, sudo is wheely good.)
Follow these clues, in order


1 uppercase character
1 digit
One of the words in my old bands name.� @

brute force

I created a bash file to generate all possible passwords:

#!/bin/bash

band=("The" "Flesh" "Curtains")

for i in {A..Z}
do
    for j in {0..9}
    do
        for k in "${band[@]}"
        do
            password="${i}${j}${k}"
            echo $password >> rickpass.txt
        done
    done
done

Then I used hydra to brute force RickSanchez's password:

hydra -l RickSanchez -P rickpass.txt ssh://192.168.56.101:22222

The password was P7Curtains.

sudo -i to go to /root dir and got the last flag. FLAG: {Ionic Defibrillator} - 30 points

Games

Hobby

Gaming is my hobby to pass the time.

I've cut down to only 1 gacha game.

Coping

I've a habit of quitting later than I'd like to. Looking back, I forced myself playing games I no longer enjoyed. I was deeply afraid of having free time to be alone with myself. Gaming, despite not providing any dopamine, shut down my thought and I didn't have to deal with negative emotions.

I'm working on tolerating negative feelings and being with myself.

Playing

Priconne

This is an auto-battle game with high production quality. I bought 1 month package, so I'm not f2p.

Usually I play for 20 minutes in the morning and another 20 minutes before bed. It's a low commitment game which respect my free times.

Rune Factory 4

I played this game on 3DS but I don't remember if I ever finished it. I loved the Rune Factory series so when it came to steam, I bought it for nostalgia. It's a relaxing and charming game, I started it up whenever I'm in the mood for planting turnips.

Done

11 March 2017 - Night in the Woods

It's a charming relatable game. It's more real than most other games as it deals with common problems that are not usually represented in games. For example, the main character, Mae, is a college drop off, a terrible insensitive jerk who suffers from depression. Her crocodile friend had to take over the family shop after her mother died and her father became a shell of himself. Her home town is in a steady decline, jobs had dried up and many were trapped in a dead end jobs. Mae's parents are in a large debt due to negative equity. Overall, it is pretty much a common sight in many small towns. And life goes on no matter what.

By the way, the game has some supernatural stuffs which resulted in a weird anticlimactic ending.

It is a flawed game, no doubt about it but the sum of its part is greater than the whole.

13 March 2017 - Bad Dream: Coma

I watched a youtube lets play of the game. It reinforced my dislike for the click-and-point adventure genre. I don't particularly enjoy looking around for a small key item for hours. My eyesights are not that great so I will mostly pass any game which requires concentrating on small pixels. In addition, the logic usually doesn't make sense to me.

As for this game, it certainly has nice atmosphere and aesthetic. That's all about it really.

19 March 2017 - SteamWorld Heist

Pretty sweet turn based strategy games, in the similar vein to XCOM but with less RNG. After playing in normal mode for over 10 hours, I decided to play the remaining at the easiest difficulty. It was actually great to be overpowered, also the length of each mission was a lot shorter.

I think I'm getting old. I don't mind playing games at the easiest difficulty. Grinding to beat higher difficulties hadn't been fun lately. Moreover I don't have a lot of free time these days to replay games, especially since I still have a long backlog of games to play.

23 March 2017 - Evoland

It's a cute fun game; its main gimmick is graphics and mechanics of old games (zelda, mario, ...) It lasts a little too long, in my opinion.

29 March 2017 - Doom 2016

Amazing run and gun game with awesome metal soundtrack. It's cathartic to blast and punch every demon in the face.

7/5/2020 - Persona 4 Golden

I started playing Persona 4 back in 2008, but I lost my save so never finished it. As the game came to PC, I decided to give it another try.

The gameplay is great, I'd describe it as traditional turn based JRPG combined with dating sim. IMO the story does overstay its welcome, the beginning feels too long and there are lot of downtimes in the middle. Moreover I prefer darker theme of Persona 3 to Persona 4. Persona 4 is still a great game though.

I got the golden ending. I'm missing a few achievements; I am not a completionist so I don't feel like starting new game + any time soon.

Thanks to the game, I became a longtime fan of SMT series and Atlus. I imported Demon's Souls, SMT: Strange Journey and SMT: Devil Survivor to UK when I was in college. Funny enough, I also lost my save to Strange Journey; maybe one day I'll attempt to complete Strange Journey Redux.

Monster Train

I'm a big fan of Slay the Spire and the former game scratches the same itch. It combines deck building with tower defense, which are pretty cool.

I got to covenant 25 so I'm taking a break from the game.

Horizon Zero Dawn

The story is ok; I zoned out a lot during the cut screens. I skipped a bunch of side quests as the game started to become a chore.

The gameplay is pretty fun, rolling around and shooting weak points on machines. At the beginning stealth was important as my weapons were limited. By the end of the game, I resolved to use explosives for everything.

Sakuna: Of Rice and Ruin

It's a pretty comfy game which is divided in 2 parts (farming and dungeoning). The controls for farming are clunky and the camera caused me nausea. Fighting is quite fun once I got into rhythm.

As usual, I didn't play any end game contents so I can't comment on that.

Skyrim

I finally completed Skyrim after restarting multiple times over the last 5 years. I completed the main quests, DLCs and guilds. There are still some quests left but I'm genuinely happy to put the game down at this point. It does feel like closing a chapter in my life.

Playing the game in 2021, it feels outdated with floaty combat and multiple crashes and game stopping bugs. At some point, the game seems like a long to do list. But I did have a lot of fun role playing a mage, an assassin, dragonborn, a vampire, a werewolf and a thief in one single playthrough.

Nioh 2

4/12/2021 - Finished main campaign

It took me a couple of restarts before I finally settled on dual swords as my main weapons. I usually stay on high stance, using Cherry Blossom and Windstorm skills. Sometimes I switched to mid stance and used God of Wind kick to deplete ki.

The beginning of the game is a bit rough but I got a lot better as I keep playing. The few final bosses did feel easy; I'm not entirely sure if it was because of good equipments or my skills.

4/23/2021 - DLCs

I completed the DLCs with glaive and magic build. Similar to dual swords, I mostly stay on high stance and use Empty Retribution and Cyclone.

Currently I'm on Way of Wisdom difficulty.

5/8/2021 - Underworld

Done 108 floors and first 5 floors of the depth with 7 Izanagi and 5 Susano. The build wasn't optimized but it still got me to the depth. When I tried floor 6, I couldn't do enough damages and the boss can kill me in 2 hits. Since I was not at max level and my equipments were around +80, I planned to spend some time farming. Google searches said that from floor 6, the depth tends to drop the same graces that I was wearing so hopefully it wouldn't take long to farm.

5/10/2021 - Depth

I switched to 7 Izanagi and 5 Oyamatsumi set to be more tanky. Moreover, I got a scroll with ultimate magic and realized that I hadn't activated any mystic art with magic. After doing so, applying buffs took less time and the game felt faster and easier.

5/16/2021 - Depth 25

I got a few better drops and changed my set to 7 Izanagi and 6 Oyamatsumi. I've done floor 25 of the depth and I'm happy to stop playing at this point.

Control

6/21/2021 - Finished

I got the game for free from epic. The story is decent, I was a fan of the X-Files so I love the concepts of dealing with paranormal activities.

I found the difficulty rather inconsistent. Sometimes the enemies kill me in just a few hits. When I went back and tried again, it was easy.

Your turn to die

August 17, 2021 - Finished chapter 3a

It is an indie death game, in the similar genre as Danganropa and 999. In chapter 2, I can choose who to die and who to save, which is a major departure from other games.

There are too many twists and turns in the game, a little bit too much in my opinion. I sometimes couldn't keep up with it so I just sat back and enjoyed the ride.

September 6, 2021 - SUPERHOT

SUPERHOT is the most innovative shooter I've played in years! Enemies only move when you move so I can pull off some sick combos.

The game gave me a discount code when I finished the story. It is like an advertisement, telling your friends to buy SUPERHOT.

October 24, 2021 - Yakuza: Like a Dragon

This is my first time playing Yakuza serie. The story is mature which is a great departure from the usual fantasy setup. I really enjoy the story with all its twists and turns.

Fire Emblem Three houses

I don't like having a full roster at the beginning of the game. I prefer a small cast at the start of the game and characters slowly get introduced.

November 20, 2021

I chose Blue Lion and completed the first route of the game. To be honest I don't like the academy setting. It felt like a drag going through the month, exploring the academy, giving lectures and gifts to keep my students' motivation high. In the second half of the game, I skipped most of the school mechanics to get to the fighting which I found more fun.

I am putting down the game for the time being. I may or may not pick it up again to play Golden Deer route.

I honestly don't enjoy this game.

December 11, 2021 - Kingdom Two Crowns

It is a comfy and relaxing game. I won after 13 hours playing.

December 18, 2021 - Monster Sanctuary

This game combined the exploration of metroid and turned base monster battle. You can have 3 monsters in a team, their auras can stack, which open up a lot of ways to build a team. Afaik there are multiple teams that can tackle the game, because most of the monsters are balanced and usable.

I had a lot of fun playing the game.

December 22, 2021 - Outriders

I like the story, the shooting is ok.

December 27, 2021 - Lobotomy Corporation

I finally finished the game after 6 months hiatus. It was great in the beginning but as more rooms were added, it took too long to finish each day. The game performance also took a hit in the late game.

January 17, 2021 - Inscryption

I played Pony Island so I at least had some ideas going into this game. It was a weird game and I enjoy the unique experience.

January 17, 2021 - Loop Hero

The first few hours of the game was fun but it became repetitive really fast.

January 25, 2021 - Needy Streamer Overload

It is a great visual novel about a streamer's life on a journey to become #1 tuber. I hate to say this but the game is a lot more realistic than I expected. I followed Hololive and read a bunch of chan posts so I'm familiar with a lot of references in the game (drugs, hiding boyfriends...).

February 4, 2022 - Death's Door

It reminds me a lot of 2D Zelda games. It didn't take too long to complete the normal ending, which I really appreciated. After getting the normal ending, I was looking up how to unlock the secret ending. I need to get all 50 life seeds which I couldn't be bothered to do, so I just watched a youtube video.

March 6, 2022 - Cyberpunk 2077

I bought the game recently at 50% discount and I had a lot of fun playing. The story writing was great and there were a lot of memorable moments.

March 12, 2022 - Shadow Warrior 3

Short and sweet.

May 28, 2022 - Elden Ring

It's one of the best game I've ever played. Besides Demon's Soul, this is the second souls I've ever finished.

My first character was a pure mage with summons, then halfway through the game I picked up Moonveil. When I reached mountaintop of the giants, I got a bit bored so I rerolled a new character.

Instead of magic, for the second character I went for pure strength build with colossal swords. At the beginning, I hold Greatsword and Grafted Blade Greatsword, then I 2-handed Starscourge Greatsword. After defeating Rykard, I respeced my stats to strength and faith. I finished the game with Blasphemous Blade and Gargoyle's Blackblade. This time, I only need to use Mimic to fight Malenia.

![done-tiny-tina-wonderlands]


created: 2021-11-08 updated: 2022-08-14

Destiny Child

Intro

Auto-battle rpg gacha mobile game.

Quit

Every raid takes too much time that I no longer want to play the game.


References

https://global.destiny-child.com/


Tags

  • [[Gacha]]

created: 2021-09-04 updated: 2022-08-21

Genshin Impact

Impressions

  • Open world
  • RPG
  • high production value
  • Gacha game.

Quit

I finally decide to uninstall the game after not touching it for a few weeks. Every time I booted it up, I had a horrible dread and constant thoughts that I should do something else.


References

https://en.wikipedia.org/wiki/Genshin_Impact


Tags

  • [[Gacha]]

July 16, 2022 - Tiny Tina's Wonderlands

The story was average and forgettable. The combat has weight, magic was a great addition to the franchise.


created: 2022-08-21 updated: 2022-08-21

Backlog

Impressions

Growing larger as years come and go.

List

It was considered by many to be a hard RPG game. I played on normal mode and found it challenging, but since I'm a fan of Megaten series, I'm familiar with the mechanics of exploiting weaknesses, buffs and debuffs.


Tags

  • [[Game]]

Homepass

StreetPass

3DS has a built-in feature StreetPass which lets nearby users to exchange data from games and applications. This is great if you live in a big city where there are a lot of 3DS devices. However, if you live in a small town, you would be lucky to just get a handful of streetpasses monthly.

StreetPass Relay

Due to that, Nintendo introduced another feature called StreetPass Relay. Every 3DS device has a whitelist of public wifi AP which it can automatically connect to. If connected, some data will be sent and stored on Nintendo server. When another 3DS user connects to the same AP, Nintendo server will send the stored data to the latter device. Consequently, 3DS devices don't have to be in close proximity to exchange data.

The whitelist contains the SSID and MAC of public wifi AP. Thus, some nice people figured out ways to create homemade StreetPass relays by spoofing MAC and SSID1. The basic idea to create a public wifi AP with the same SSID and MAC as in the whitelist.

For Raspberry Pi, there is SpillPass-Pi2 which work automatically when you plug in. You only need a wifi dongle wlan0 which support mac spoof and a wired internet connection eth0.

My setup is slightly different because I don't have a wired connection to the home router. What I have is 2 wifi dongles, wlan0 and wlan1. The idea is still the same, but instead of eth0 bridge to wlan0, I have wlan1 connected to the internet and wlan0 as wifi AP. All the traffic are forwarded to/from wlan0 to wlan1.

Setup

I used Raspbian Jessie Lite image. I don't have external keyboard or monitor so desktop on Raspberry Pi is unnecessary. Installed the image on the SD card by either dd or Etcher, then added your wifi network to /etc/wpa_supplicant/wpa_supplicant.conf.2

#/etc/wpa_supplicant/wpa_supplicant.conf
network={
    ssid="testing"
    psk="testingPassword"
}

Updated and installed softwares:

sudo apt update && sudo apt upgrade
sudo apt -y install hostapd dnsmasq haveged iptable-persistent sqlite3

I used this wonderful guide to setup forwarding.

Interfaces

Set wlan0 to a static ip address 10.0.0.1.

#/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet manual

# AP
allow-hotplug wlan0
iface wlan0 inet static
    address 10.0.0.1
    netmask 255.255.255.0

# wireless
allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Tell DHCPCD to ignore wlan0.

#/ect/dhcpcd.conf
denyinterfaces wlan0

Hostapd

Hostapd is an user daemon to start up AP. In /etc/default/hostapd, uncomment or add the line DAEMON_CONF=/etc/hostapd/hostapd.conf.

#/etc/hostapd/hostapd.conf
#sample hostapd.conf
#overwrite by homepass.sh

ssid=attwifi
bssid=34:bd:c8:db:79:00

interface=wlan0
driver=nl80211

hw_mode=g
channel=6
auth_algs=3
wpa=0
rsn_pairwise=CCMP
beacon_int=100

macaddr_acl=0

wmm_enabled=0
eap_reauth_period=360000000

You can test if AP is working by running sudo hostapd /etct/hostapd/hostapd. You should be able to see attwifi.

I use dnsmasq to map IP addresses to MAC addresses. When 3DS connect to my hotspot, it will be assigned a dynamic IP address. It is also possible to bind 3DS MAC address to a static IP address.

#/etc/dnsmasq.conf
interface=wlan0
except-interface=wlan1
dhcp-range=10.0.0.2,10.0.0.255,12h

Port forwarding

In /etc/sysctl.conf, uncomment net.ipv4.ip_forward=1.

sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o wlan1 -j ACCEPT
sudo sh -c 'iptables-save > /etc/iptables/rules.v4'

Start services sudo service hostapd start && sudo service dnsmasq start. Reboot Raspberry Pi and test if attwifi can be connected to the internet.

systemd service and timer

I use systemd to run my homepass.sh at boot time and the script will rerun every 5 minutes to change wlan0 to new SSID and MAC.

#/etc/systemd/system/homepass.service
[Unit]
Description=Homepass

[Service]
ExecStart=/home/pi/homepass.sh

[Install]
WantedBy=multi-user.target
#/etc/systemd/system/homepass.timer
[Unit]
Description=Run homepass.service every 5 minutes

[Timer]
OnStartupSec=10
OnUnitActiveSec=5min
Unit=homepass.service

[Install]
WantedBy=multi-user.target

Enable the timer by executing this command

systemctl enable homepass.timer
systemctl start homepass.timer

A nice feature of using systemd to run the script is we can access the logging easily for debugging

journalctl -u homepass

homepass.sh

This script was modified from orginal script by Semperverus. You can check out his guide for more details about HomePass. I took the idea of using sqlite3 to store MAC and SSID in a database from danielhoherd's script.

The script is rerun every 5 minutes by systemd. It stops current running hostapd service. A new /etc/hostapd/hostapd.conf is generated from querying MAC and SSID from a database. The hostapd service is then restarted with the new conf file.

#!/bin/bash
service hostapd stop

SLEEP_TIME=300
DB=/home/pi/homepass.db
CONFIG_FILE=/etc/hostapd/hostapd.conf

if [[ ! -e "$CONFIG_FILE" ]] ; then
  touch "$CONFIG_FILE"
fi

read -d '' query << EOF
SELECT mac, ssid
FROM aps
WHERE last_used < datetime('now', '-2 days') OR last_used IS NULL
ORDER BY random()
LIMIT 1;
EOF

result=$(sqlite3 "$DB" "$query")
resultArr=(${result//|/ })

MAC=${resultArr[0]}
SSID=${resultArr[1]}

if [[ -z "$MAC" ]] || [[ -z "$SSID" ]] ; then
  echo "missing MAC or SSID"
  exit 1
fi

sqlite3 "$DB" "UPDATE aps SET last_used = datetime('now') WHERE mac = '$MAC'"

cat > $CONFIG_FILE << EOF
ssid=$SSID
bssid=$MAC

interface=wlan0
driver=nl80211

hw_mode=g
channel=6
auth_algs=3
wpa=0
rsn_pairwise=CCMP
beacon_int=100

macaddr_acl=0

wmm_enabled=0
eap_reauth_period=360000000
EOF

echo "==========================================="
echo "SSID:" $SSID "- BSSID:" $MAC
echo "Time before next change:" $SLEEP_TIME "seconds"
echo "Current time:" $(date)
echo "==========================================="

service hostapd start

All files

You can find all my files at my github repo.

Books

I'm writing notes to remind myself of the texts' key points. If ever permitted by life and time, I would love to read some of these books again. In the meantime, those short summaries are sufficient.

There is a large gap between what I read and what I understand. I have a small goal in my mind, to learn a bit more after each reading session. That target has been realistic for me so far.

I recently bought a Kindle paperwhite kids on Black Friday 2021. This will make it easier for eyes, compared to reading on PC screen.

Kindle automatically added books to goodreads so I'm using it from now on to keep track of my reading.

Light Novels

Kumo

Book 12.

Reverend Insanity

The story ended in a cliffhanger as the the book is banned in China. It was a fun and easy read.

Manga

Chainsaw Man

It was pretty fun manga from the same artist as Fire Punch. It is shorter and more concise than his previous work. I didn't feel like the manga overstayed its welcome.

I don't exactly like the idea that eating devils make them forgotten though.

Decisive

When making an important decision, try to:

  • widen your options
  • test your assumptions
  • take steps back before deciding
  • prepare to be wrong

The Problems of Philosophy

The book is recommended as an introduction to philosophy. In some way, it is as it gives a brief overview of the subject, but it is also dense as it attempts to condense a lot of concepts into a single book for layman.

It took a month to finish the book. I don't understand the majority of details and nuances, but I'm content that I've learnt a bit more about the subject.

Chapter 1 - Appearance and Reality

What I see as a table is not exactly the table itself but what my senses perceive and construct.

Chapter 2 - The Existence of Matter

There is not a significantly strong argument that the table actually exists outside of our senses.

Knowledge is built upon our instinctive beliefs. Some beliefs are stronger than others. If one is found to be mistaken, it's to be replaced by another, more correct belief.

Chapter 3 - The Nature of Matter

There's no evidence that matters have intrinsic properties. For example, the color of a table is a result of light waves reaching our eyes. If we modify the air, the color changes. Thus, it can't be argued that the table actually has colors.

Chapter 4 - Idealism

There's a difference between the act of apprehension and the apprehended object. The act (see, hear, touch...) is mental and in our mind, the object isn't.

Chapter 5 - Knowledge by Acquaintance and Knowledge by Description

Knowledge by acquaintance: we're directly aware of.

  • When I perceive the table, I'm acquainted with the sense-data (color, shape, hardness...).
  • We also use introspection to collect data from inner sense (thoughts, desires, feelings...). Not only we're aware of things but we're also aware of being aware of things; this is called self-consciousness.
    • Tangent: when I meditate, who is the I that is observing?
  • We have acquaintance in memory. We remember and can recall what we have acquainted in the past.

Knowledge by description: inferred from knowledge by acquaintance.

  • I know a description of the table, based on the sense-data. The physical table itself isn't known to me.

Chapter 6 - Induction

Frequent repetition of some uniform succession or coexistence leads us to expect the same succession and coexistence on the next occasion.

The sun has risen for 30 years of my life, I expect the sun will go up tomorrow. The oftener the sun rises, the more probable it will rise tomorrow. As more time passes and the sun keep rising, the probability will amount almost to certainty. It'll never reach certainty because there's a chance of failure (the sun will die some day in the future, earth may collide with an asteroid and stop rotating).

Chapter 7 - On Our Knowledge of General Principles

All knowledge is elicited and caused by experience; some knowledge is a priori, experience doesn't suffice to prove it.

Induction goes from particular to particular or from particular to general.

Deduction goes from general to general or from general to particular.

Chapter 8 - How a Priori Knowledge is Possible

I couldn't summarize the chapter as I don't really understand the main point.

Chapter 9 - The World of Universals

For Plato's theory of ideas, what is justice?

We need to consider just acts and find out what they have in common. They must have some common nature which can be found in just acts and in nothing else. The common nature will be justice itself. The idea "justice" is not particular, it's eternally itself, immutable and indestructible (I don't understand the leap from not particular to timeless).

A universal is anything which is shared by many particulars, and has characteristics which distinguish justice from just acts.

A sentence is made up by at least one word which denotes a universal. In "I like this" sentence, "like" is a universal because I may like other things and other people may like things.

All truths involve universals and all knowledge of truths require acquaintance with universals.

Chapter 10 - On Our Knowledge of Universals

Knowledge of Universals come from acquaintance. When I see a brown table, I'm acquainted with the particular table. After seeing multiple brown tables, I can abstract the brownness which they all have in common and from that I become acquainted with brownness universal.

Similarly, I'm also acquainted with relation (left, right, before, after, similar, different...).

Returning back to priori knowledge, they deal exclusively with relations of universals. We may know a general proposition without knowing a single instance of it.

Chapter 11 - On Intuitive Knowledge

Some general principles are self-evidence, incapable of proof.

Truths of perception are self-evidence truths which are derived from sense-data.

In addition to sensation, our intuitive judgements also employ memory. However, memory can be fallacious so it has degrees of self-evidence corresponding to the degrees of its trustworthiness. Events which are vivid and recent have higher level of trustworthiness and self-evidence.

Degrees of self-evidence, ordered from highest:

  • Truths of perception, some principles of logic and truths of immediate memory.
  • The inductive principle.
  • Memories as we go further into the past
  • The truths of logic and maths as they become more complicated.
  • Judgements of intrinsic ethical or aesthetic value.

Chapter 12 - Truth and Falsehood

We may believe what is false as well as what is true. Many people hold different and incompatible opinions on the same subjects, some of those beliefs are erroneous.

Truth must have an opposite, falsehood. If there is no beliefs, there would be no truth or falsehood. The truth and falsehood of a belief depends upon something which lies outside the belief itself.

Beliefs depend on the mind to exist but do not depend on the mind for their "truth".

For every act of judgement, there's a mind which judges and there are several terms which it judges. When A believes B loves C, A is the judge, while B, loving and C are the objects to be judged. The "B loves C" is a complex unity, which is also called "fact corresponding to the belief". A belief is truth when there's a corresponding fact and false when there is not.

Chapter 13 - Knowledge, Error, and Probable Opinion

A true belief isn't knowledge when it's deduced from a false belief. When a logical process is fallacious, a true belief derived from it can not be considered knowledge.

Theoretically there are 2 ways a fact can be known by:

  • judgement, several parts are judged to be related as they are in fact related.
  • acquaintance with the complex fact itself.

The second way is only possible if its parts have relation which makes them combine to form a complex. The first way gives us parts and relation severally, the relation may not relate parts in that way and yet the judgement may occur.

A truth is self-evident when we are acquainted with the corresponding fact. When A believes B loves C, if the belief is true, the corresponding fact is "B's love for C". Only B may have an acquaintance with this fact, so the truth (if it's a truth) is only self-evident to B.

Intuitive knowledge is trustworthy in proportion to the degree of its self-evidence. What we firmly believe, if it's true, is called "knowledge", provided it's either intuitive or inferred from intuitive knowledge. What we firmly believe, if it's false is called "error". What we firmly believe, if it is neither knowledge or error, and also what we believe hesitatingly, because it's derived from something with lower degree of self-evidence, may be called "probable opinion".

Chapter 14 - The Limits of Philosophical Knowledge

Philosophy is a criticism of knowledge. It's determined to consider each piece of knowledge on its own merits, then retain or reject them after consideration is completed.

Chapter 15 - The Value of Philosophy

As soon as definite knowledge concerning any subject become possible, this subject ceases to be called philosophy, and becomes a separate science.

The value of philosophy is to be sought in its uncertainty. The man who has no idea of philosophy goes through life imprisoned in the prejudices derived from common sense, from beliefs of his age or his nation. To them, the world becomes more definite, finite, obvious. As soon as we philosophize, most everyday things lead to problems to which only incomplete answers can be given. Though, unable to tell us what is the true answer, philosophy is able to suggest possibilities. While diminishing our feeling of certainty as to what things are, it increases our knowledge as to what they may be; it shows familiar things in an unfamiliar aspect.

Philosophical contemplation enlarges both the Self and not-Self.

The Psychology of Money

I read this book as I want/need to be better at handling money.

Chapter 1 - No One's Crazy

I've seen the same sentiment in The Problems of Philosophy, the only thing that I can be certain about the world is myself. Even then, I don't exactly know what 'self' is.

Everyone has their own unique experience due to different upbringing, different environment, different timeline. It's hard to imagine the thoughts, values and beliefs other people have. I can read about the history of the Great Depression but I will never have the emotional scars of those who experienced it firsthand.

Personal experience defines and shapes one's risk tolerance. In another word, it is just luck of when and where you were born.

If I lived paycheck to paycheck, it would be reasonable to buy lottery tickets as they seem like the only option to get me out of the poverty.

Chapter 2 - Luck & Risk

Every outcome is determined by luck in additional to the individual action. It's difficult to identify how much of an outcome is attributed to either luck and skill.

Risk and luck are doppelgangers.

Chapter 3 - Never Enough

  • The hardest financial skill is getting the goalpost to stop moving.
  • Comparison, ego is the killer of joy.
  • Enough is not too little
  • There are many things not worth risking

Chapter 4 - Confounding compounding

Ah, compounding interest, I read Economics at university so I'm familiar with the concept. However, it took me a long time before I started investing seriously in low cost index funds.

Consistent small increase over time will create a tremendous result.

Chapter 5 - Getting Wealthy vs Staying Wealthy

To stay wealthy, one needs to be frugal and not consistently screw up.

Survival mindset:

  • I need to survive long enough for compounding to work its wonders. It's all about growth amid loss.
  • Plan on the plan not going as planned. Always have room for error (a frugal budget, flexible thinking, a loose timeline).
  • Hope for the best, prepare for the worst.

Chapter 6 - Tails, You Win

Long tails, a few events can contribute to the majority of outcomes. Most of an index fund's returns can come from a small amount of companies.

You can be wrong half of the time and still make a fortune. It isn't whether you're right or wrong, but how much you make when you're right and how much you lose when you're wrong.

Chapter 7 - Freedom

Wealth is the freedom to do what you want, with who you care about every day.

Control over time has diminished compared to previous generations. Knowledge workers whose job is to think, have their mind occupied with work even when they are out of office.

Chapter 8 - Man in the Car Paradox

When I see a sport car, I admire the car without paying attention to the driver.

Chapter 9 - Wealth is What You Don't See

I can't see other people's bank accounts or brokerage statements, so I judge their wealth by their outer appearances (cars, houses, Instagram...). Their possessions could be rented or bought with debt, hence what I can see isn't a good indicator of how wealthy others are.

Wealth is financial assets that haven't been converted into tangible stuff. I need the restraint to be wealthy, to save money today so I have an option to purchase more tomorrow. That doesn't mean I need to spend money tomorrow, it just means that I have the choice to do so.

Chapter 10 - Save Money

In order to build wealth, I need to save money (spend less than I earn and invest).

The value of wealth is relative to what I need. If I need to spend more to be happy, I'll have a lower saving rate, and it takes longer to retire, ceteris paribus. If I'm content with lower spending, I can save more and I've more time to enjoy my retirement.

Savings without a spending goal gives me options and flexibility.

Chapter 11 - Reasonable > Rational

I'm a screwed up, emotional person. Reasonable is more realistic and I have more chance of sticking with it for the long run, than being rational.

Chapter 12 - Surprise

Things that have never happened before happen all the time.

Over reliance on history to predict the future:

  • You'll likely miss the outlier events that move the needle the most.
  • History can be a misleading guide to the future because it doesn't account for structural changes in today's world.

The correct lesson to learn from surprises is that the world is surprising. I should use the past surprises as an admission that I have no idea what might happen next.

Chapter 13 - Room For Error

Acknowledge that uncertainty, randomness, and chance are parts of life. The purpose of the margin of safety is to render the forecast unnecessary.

I have to survive to succeed.

Avoid single points of failure. An example is sole reliance on a paycheck to pay short term expenses, without any saving.

Saving without any reason is important as it gives me flexibility in the face of unpredictable events.

Chapter 14 - You'll Change

I don't know today what I will even want in the future.

Avoid extreme ends of the financial planning. Aim for moderate income, moderate saving, moderate free time... helps to increase the odds of sticking with a plan and reduce regrets.

Sunk costs make our future selves prisoners to our past, different selves.

Chapter 15 - Nothing's Free

Everything has a price, I need to figure out what the price is and whether I'm willing to pay. The problem is the price isn't oblivious until I've experienced it firsthand.

Most things are harder in practice than they are in theory. This is because I'm not good at identifying the actual price of success.

Chapter 16 - You & Me

Other investors have different goals than me. Day traders care a lot about the momentum (daily price change) than the actual share price whereas long term investors care about the share price in the long run. We are playing different games with different rules.

I need to identify the game I'm playing. If I'm a passive investor and my time horizon is 30 years, it doesn't matter if there is a recession next year.

Chapter 17 - Seduction of Pessimism

Pessimists often extrapolate present trends without accounting for how the markets adapt.

Perfect and awful circumstances rarely stay that way for long because supply and demand adapt to the new environment.

Progress happens too slowly to notice, but setbacks happen too quick to ignore.

Chapter 18 - When You'll Believe Anything

The more I want something to be true, the more I want to believe in a story that overestimates the odds of it being true. There are many things that I think are true because I desperately want them to be true.

Everyone has an incomplete view of the world, but we form a complete narrative to fill in the gaps.

Hindsight, the ability to explain the past, gives us the illusion that the world is understandable. It makes us think that the world makes sense, even when it doesn't make sense.

We need to believe that we live in a predictable, controllable world, so we turn to authoritative-sounding people who promise to satisfy that need.

Chapter 19 - All Together Now

In summary:

  • Find humility when things go well and compassion when they go wrong, because it is never as good or as bad as it seems.
  • Less ego, more wealth.
  • Manage your money in a way that you can sleep well at night.
  • Increase your time horizon as it makes little things grow big and big mistakes fade away.
  • Be OK with a lot of things go wrong. I can be wrong half of the time and still make a fortune.
  • Use money to gain a control over time.
  • Be nicer and less flashy.
  • Don't need a reason to save.
  • Define the cost of success and be ready to pay it.
  • Have room for error.
  • Avoid extreme ends of financial decisions.
  • Define the game I'm playing.

The Myth of Sisyphus

Why rolling a stone uphill all day and then redo it again the next day?

Chapter 1 - An Absurd Reasoning

Chapter 1.1 - Absurdity & Suicide

Many people die because they judge life is not worth living. Many people die for the ideas that give them a reason for living (a reason for living is also a reason for dying).

Killing yourself amounts to confessing that living is not worth the trouble. Dying voluntarily implies you recognized the insane character of daily habits, the absence of reason for living and the uselessness of suffering.

A world that can be explained even with bad reasons is a familiar world. A world in which a man is a stranger deprived of a promised land, will give rise to the feeling of absurdity. In the second world, suicide seems like a reasonable solution to the absurdity.

Chapter 1.2 - Absurd Wall

If I look around, absurdity is every where. One day I am a busy bee, worrying about finishing my tasks on time; the next day, the feeling of dread arises, the question of "why" always comes up with no good answers. Some days I just stop and realize how old and tired I feel; I know I will continue aging and I am practically marching to death.

This is not new, everything that has been said has been said casually in literature and daily conversation. What is more important than the discovery of absurdity is the consequences.

Forever I shall be a stranger to myself. I can define and summarize attributes of my self, then adding them up, and even then the sum is not enough to describe the self. There are truths but no truth, "know thyself" seems meaningless as I can know the approximated self but not the true self.

Chapter 1.3 - Philosophical Suicide

To be absurd means to be contradictory. It is a divorce between a fact and a reality. It lies in neither of the elements compared; it is born out of their confrontation. The absurd is not in man nor in the world but in their presence together.

Existential philosophies suggest escape in face of absurdity.

For Karl Jaspers, the absurd becomes god and the inability to understand becomes the existence that illuminates everything.

For Chestov, "We turn toward God only to obtain the impossible. As for the possible, men suffice." Being aware of the absurd amounts to accepting it, and it is proved only to be dispelled. The absurd does not lie in man's universe, but with God in eternity. The struggle is eluded, causing to disappear its essential characters (opposition, laceration, and divorce). To Chestov reason is useless but there is something beyond reason. To an absurd mind reason is useless and there is nothing beyond reason.

For Søren Kierkegaard, antimony and paradox become criteria of the religious. The thing that led to despair of the meaning and the depth of this life gives it its truth and its clarity. "In his failure, the believer finds his triumph." Since nothing is proved, everything can be proved.

For Edmund Husserl, the abstract world becomes god itself. Reason has no limits in that world. "If all masses subject to attraction were to disappear, the law of attraction would not be destroyed but would simply remain without any possible application.", which is tantamount to "If we could contemplate clearly the exact laws of psychic processes, they would be seen to be likewise eternal and invariable, like the basic laws of theoretical natural science. Hence they would be valid even if there were no psychic process." The absurd, on the contrary, establishes its limits since it is powerless to calm its anguish.

Chapter 1.4 - Absurd Freedom

Life will be lived knowing it has no meaning. Living is keeping the absurd alive; there is no hope, the fate is certain but there is no resignation. It is the constant struggle that keep us aware of the experience.

Suicide is acceptance at its extreme; in a way, suicide settles the absurd by killing both the human and the absurd. As for the absurd man, he is a living man condemned to death, who is aware of looming doom and yet simultaneously reject death. In that revolt, he gives proof to his only truth, which is defiance.

One certainty when completely turning toward death is that there is no future. It is liberating to be feel remote from one's own life to increase it and take a broad view of it. This independence has a definite time limit, like any freedom of action. In front of the absurd man is a limited universe, and beyond which is nothingness. He can then decides to accept such a universe and draw from it his strength, his refusal to hope, and the unyielding evidence of a life without consolation.

To an absurd man, his freedom has no meaning except in relation to its limited fate. The more he struggles, the more he lives. In that sense, it isn't the best living but the most living that he wants. To two men living the same number of years, the world always provide the same sum of experience. It is up to us to be aware of them. Being aware of one's life, one's revolt, one's freedom, and to the maximum, is living to the maximum.

The preceding merely defines a way of thinking. But the point is to live.

Chapter 2 - The Absurd Man

Chapter 2.1 - Don Juanism

Don Juan loves every woman with the same passion, hence he must repeat his quest. He isn't melancholy because he knows his limit and does not hope.

The ultimate end, awaited but never desired, the ultimate end is negligible.

Chapter 2.2 - Drama

All kinds of fame are ephemeral. In 10,000 years, Goethe's works will be dust and his name forgotten. Meditated upon, it reduces our perturbations to indifference. Above all, it directs our concerns toward what is most certain, the immediate, the now.

Chapter 2.3 - Conquest

Wise man lives on what he has without speculating what he has not.

Chapter 3 - Absurd Creation

Chapter 3.1 - Philosophy & Fiction

Creating art is living doubly, it is just as much experiencing as reflecting. All try their hands at miming, at repeating, at recreating the reality that is theirs. Creation is the great mime.

To think is first of all to create a world (or to limit one's own world).

Chapter 3.2 - Kirilov

"If God does not exist, I am god." To become god is merely to be free on this earth, not to serve an immortal being.

All is well, everything is permitted, and nothing is hateful.

Chapter 3.3 - Ephemeral Creation

To work and create for nothing, to sculpture in clay, to know that one's creation has no future, to see one's work destroyed in a day while being aware that fundamentally this has no more importance than building for centuries.

To create is likewise to give a shape to one's fate. For all those characters, their work defines them at least as much as it is defined by them. There is no frontier between being and appearing.

Chapter 4 - The Myth of Sisyphus

If there is a personal fate, there is no higher destiny, or at least there is but one which the absurd man concludes is inevitable and despicable. For the rest, he knows himself to be the master of his days.

The struggle itself toward the height is enough to fill a man's heart. One must imagine Sisyphus happy.

Meditation

I have a couple of problems with Stoicism, at least the one described in the book, not the modern Stoicism which I am not familiar with.

One, I don't understand the concept of Virtue and one can have the best life by following Virtue.

Second, nature is good and everything that follows nature is good. I don't agree with this point; to me nature is nature, good and bad are merely labels we assign to things we value and dislike.

Chapter 1 - Debts and Lessons

The chapter reads like a gratitude diary which I did for Science of Well-being course. He was grateful for the people and the circumstances in his life.

Chapter 2 - On The River Gran, Among The Quadi

I am actually surprised how relevant and relatable his opinions are. It is fascinating how philosophies and religions (I am mostly familiar with Buddhism) share many commonalities.

I have a weird thought while reading the chapter. The life stories that I tell myself and others create a narrative about who I are. From disjointed anecdotes (chaos), I discover a pattern (order) about my self; even the introduction page of my wiki reads like an attempt for self discovery. My identity isn't fixed because my values change over time, and through retrospection I sometimes rewrite the past narratives. I don't know if true self even exists but I am leaning more toward no.

I am not sure where I am going with that. Anyway, back to the book.

  • Don't be a slave to your desires.
  • You have limited time on Earth, use it to free yourself or it will be gone forever.
  • You can't entrust your happiness to others.
  • Find your purpose in life, toward which you can devote your thought and impulse.
  • Treat yourself with respect, look within yourself.
  • You can't lose either the past or the future; you can't lose what you don't have. The present is all you can give up since that is all that you have.
  • The body and its parts are a river, the soul a dream and mist. life is warfare and a journey far from home, lasting reputation is oblivion.

Chapter 3 - In Carnuntum

  • Not only we move closer to death, our mind may also deteriorate.
  • Decay/death is a nature process.
  • Don't try to keep up with the Joneses, as it will distract you from focusing on your own mind.
  • If, at some point in your life, you find your purpose, embrace it without reservation.
  • Each of us lives only now, this brief instant; the past is already gone and the future is impossible to predict.
  • Examine your life, your thoughts.
  • Write off your hopes, be your own savior.

Chapter 4

  • Thoughtful, mindful actions
  • The world is nothing but change. Our life is only perception.
  • Do less better. Eliminate unnecessary assumptions and actions.
  • Everything fades so quickly, turns into legend, and soon oblivion covers it.
  • It is not the events that upset us, but our judgement about the events.

Chapter 5

  • Even an emperor has trouble getting out of bed.
  • Do good without expectation.
  • Embrace your imperfect, accept who you are, only then you can improve yourself.
  • Things that irritate us don't last forever.
  • Not to be overwhelmed by what you imagine, just do what you can and should.
  • Fortune comes and goes. You need to make fortunes for yourself (good character, good intentions, good actions).

Chapter 6

  • Do what you can.
  • Look inward.
  • Our choices come from our own experience. Expand your experience, expand your choices.
  • Pride is a master of deception.
  • Change if what you are making a mistake or looking at things from the wrong perspective.
  • Sanity means typing your well-being to your actions, not to external things.
  • Practice hearing what others say.

Chapter 7

  • Focus on what is said when you speak and on what results from each action.
  • It is fine to need help.
  • Don't be afraid of changes. Nothing can exist without it.
  • Be sympathetic to other human beings.

Chapter 8

  • Your position, your reputation are obstacles.
  • To change your mind and to accept correction are free acts.
  • If it's in your control, why do you do it? If it's in someone else, why do you blame yourself?
  • You could be good today, instead of choosing to be good tomorrow.
  • You have to assemble your life yourself, action by action.
  • Give yourself a gift: the present moment.
  • Why do you want praise and approval from people who despise themselves?

Chapter 9

  • View death as one of the things that happen to everything.
  • Act not for pity, sympathy or admiration.

Chapter 10

  • Stop talking about being a good person, just be one.
  • Ask yourself why you are afraid of death.
  • No matter how good a life you have led, there'll be people who cheer at your demise.
  • Ask yourself why you are doing this.

Chapter 11

  • You need a consistent goal in life to life in consistent way.
  • Popular beliefs are the monsters under the bed.

Chapter 12

  • We love ourselves more than other, but car more about their opinions than our own.
  • Practice even what seems impossible.
  • If it is not right, don't do it. If it is not true, don't say it.

On the Genealogy of Morals

The book was thought-provoking and I enjoy every moment of it.

First Essay - Good and Bad

The idea of good comes from the noble class. It is no surprise that noble means good in dictionaries. Bad which is opposite of good, therefore must represents non-noble or common class.

Second Essay - Guilt, Bad Conscience and the Like

Society enforces morality on its members through punishments. We learn fast through pain. The stronger the society, the more lenient it is to the violators.

Guilt comes from creditors and debtors. Being indebted to someone will result in being guilty.

We are indebted to our ancestors, we feel guilty that the debt can never be repaid. The stronger the tribe, the bigger the debt feels like. As the tribe grows more powerful, ancestors become bigger and scarier. In the end, the later transformed into heroes and gods.

With the rise of atheism and the decline of religions, the mankind's feeling of guilt subsides.

Third Essay - What is the Meaning of Ascetic Ideals?

I'm putting reading the book on hold; I may come back in the next few years.

Media

Movies and tv shows, youtube and livestreaming.


created: 2022-08-14 updated: 2022-08-21

Watching

Doom Patrol

Season 2.

HealthyGamerGG

I started watching the channel after Reckful. I've been trying meditation and improving myself and it's a daily struggle.


Tags


created: 2020-08-14 updated: 2022-08-14

Hololive

Impressions

I watched a couple of Kizuna Ai videos a few years ago then completely forgot about the whole things. On August 2020, I did a quick google to see what is going on with her channel and found out about the new company, VA changes... YouTube started to recommend me some Hololive clips; a few days later I began to watch them live.

Tools

  • Holodex for following schedules and knowing who is currently live.

Graduation

In Japanese idol culture, an idol celebrate their retirement with a graduation ceremony to say goodbyes to their fan. In the context of vtubers, it's more like the final day of a job before they move to another job. The character they used to play is dead, they're getting a new one.

In theory, it should be the same as an end of beloved TV or book series. Yet I felt different. For whatever reason, the whole thing feels artificial, it isn't authentic or sincere to me.


References


Tags

  • [[Vtuber]]

Done

9 March 2017 - Sing

It was ok; just a fun but forgettable animation.

9 March 2017 - Doctor Strange

It was quite entertaining because I turned off my brain.

26 March 2017 - The Host

A Korean monster film which is pretty great, in my opinion. It has really nice cinematography.

It's also anti america with a lot of references to past incidences committed by USA.

2 April 2017 - Fantastic Beasts and Where to Find Them

It's an ok movie, I don't particularly like or hate it.

26 April 2017 - Oldboy

It was a great revenge tragedy movie. The fighting choreography was top-notch, especially the hallway fighting which looked like a single cut. Sad ending which I'm still trying to process.

27 April 2017 - The Game

A great movie with incredible twists and turns. I love it.

The Platform

I really like the movie and its social commentary. It reminds me of the sayings 'Where you stand depends on where you sit.' and 'Pick your battles.'. I heard of them a lot around 2008 during the financial crisis.

Personally I deliberately and subconsciously choose to be ignorant on many topics. Maybe one day I'll educate myself on them.

Aggretsuko

I binge watched all 3 seasons in 2 days. The first 2 seasons are great but the last one left me confused.

Every character is flawed and relatable. They all did the best that they could even if they were bad decisions. I understand their motives but that certainly doesn't make me like them any more, which isn't a bad thing in itself.

The season 3 finale kinda feels like reverting things back to the original status quo. But the cat is already out of the bag so it'll never be the same again. Maybe to move forward, you need to step back and think. The truth is you can never go back to square 1, time passes, things change.

Godzilla 2014

It's ok. The monster fight is at night and the screen is too dark for me to see.

Taskmaster

I was an avid watcher of the show, then life happened and I forgot about it. One day I had a random thought to check out how the tv show was doing. It's still going strong and series 11 is broadcasting at the moment.

15/4/2021 I finished the series 10. Despite recording during covid, the show still has its charm.

August 26 2021 - Guns Akimbo

Harry Potter with guns. He could have avoided the situation had he used VPN. It was a bit too violent for my taste but overall I had a lot fun watching the movie.

August 26 2021 - Interstellar

I watched the movie with Space, Time and hlgg. It was a great movie even if I don't understand every detail. The ending was satisfactory and rewarding.

September 25 2021 - Dredd 2012

Overall it was a cool movie. The plot is simple, the visual is nice and the movie length is short enough to keep me interested.

September 28 2021 - Squid Game

I'm a sucker for death games (Liar game, Kaiji) so I went in with high expectation. Overall, it was an enjoyable series but I dislike the ending and the main character.

May 9 2022 - Everything Everywhere All At Once

I love it.

June 18 2022 - Margin Call


created: 2021-07-21 updated: 2022-08-13

Audio

Impressions

I am not an audiophile, I don't know what people talk about when they describe the sound as bright or dark. I usually rely on reviews and Reddit to figure out what devices have good value and make my purchasing decisions based on them.

DAC

As most modern phones no longer has a headphone jack, I got FiiO-BTR3, a Bluetooth DAC, so I could use my wired headphone. It's a great portable device, it is small, and I can clip it on shirt.

My BRT3 died after 3 years, so I'm buying Qudelix-5K to replace it.

Headphone

For 5-6 years, I used a pair of Sennheiser HD25. I replaced the cables multiple times over the years, which is cheaper than getting a new pair.

I absolutely loved it, the sound was just so clear to my ears. However, before I bought these, I only used cheap earbuds, so I don't have a great point of reference.

In 2022, after using Aria for almost a year, I've finally decided to retire HD25.

IEM

My ears got extremely hot wearing HD25, I sweated a lot after 30 minutes wearing them. That's why I decided to get IEM.

I got Moondrop Quarks as it's cheap, and I want to test out how IEM fits. The sound was ok, but the default earbuds didn't fit my ears.

After trying the Quark and reading a bunch of favorable reviews of Moondrop Aria, I purchased it. Even though it's bigger than Quark, it fits a lot better on my ears. I also got Linsoul cable and SpinFit CP100+ to replace the stock cable and earbuds, respectively. Overall, for the price, I really like Aria.


Tags

Mind

I'm in a better place mentally and physically. There have been a lot of ups and downs, and it'll be the same going forward.

In yet another iteration, I'm using a text file as a diary/journal. As I keep writing, words come out a lot easier.

The Science of Well-Being

Misconceptions about happiness

  • Knowing is not enough to change my behavior.1
  • People generally overestimate the duration of their reactions to negative events.2
  • Emotional well being increases as income rises but there is no improvement in happiness beyond an annual income of ~$75,000.3
  • People with materialist altitude have lower life satisfaction in life. 4
  • Married people are happier for first few years and then happiness returns to baseline. 5
  • Happiness come from 50% gene, 40% controllable action/thoughts and 10% uncontrolled life situation. 6

Why our expectations are bad

Miswanting: being mistaken about what and how much you will like something in the future.

  • Our intuitions are often wrong. 1
  • Our mind don't think of absolutes but in term of reference points:
    • Where we are now.
      • For every $1.00 increase in your actual income, your required income to be happy increases by $1.40. 7
    • Where other people are (social comparison).
      • Unemployed people are happier when unemployment rate in their area is high. 8
      • "It's a recession when your neighbor loses his job; it's a depression when you lose yours."
  • Hedonic adaptation as we become accustomed to a positive or negative stimulus such that the effects are attenuated over time.
  • We don't realize that our minds are built to get used to stuff.

Overcome biases

  • Don't invest in physical stuff, invest in experience as experience is short lived and we don't adapt to experience as fast as materials.
  • Thwart hedonic adaptation
    • Savoring. Take a step back and appreciate an experience at present, don't focus on the past or future.
    • Negative visualization. Contemplate what you have and visualize your life without them.
    • Gratitude. Write down 5 things you are grateful for every week.
  • Reset reference point
    • Concretely re-experience. Go back and re-experience old referent point. I sometimes think of my previous job, which makes me appreciate my current job more.
    • Concretely observe. I have many fantasies of "if only I have", so going out and actually experience those fantasies.
    • Avoid social comparison. Meditate, avoid social media.
    • Interrupt your consumption. For good things, space them out over a period of time will increase happiness. For bad things, experience them all at once instead of splitting them.
    • Increase variety.

What make us happy

Right parts of what we already want

  • Job
    • People who use signature strength are more productive and satisfied with their job. 9
    • Increase flow, engaging in high challenge high skill work.
  • External goals (money, grades, cars...)
    • Extrinsic motivation can undermine intrinsic motivation.
    • Adopt a growth mindset instead of goal mindset.

Kindness

Spending money on other people can make you happier. 10

Social connection

You don't need make deep connection to be happier, talking with strangers make both happier. 11

Time Affluence

Psychology of Money also points out that having more time is more important than money.

Mind

When we no longer think about the current task, our brain fall back to default mode network. Our mind wanders, think outside of the now and here (future, past). This makes us feel bad. 12

Meditation not only shuts off the default mode network 13 but also make us happier in the long run. 14

Healthy practice

We all know physical exercises make us healthy and happy. We all know getting 8 hours of sleep is healthy.

Strategies for better habits

Situation support

  • Fix bad environment
    • Reduce access to unhealthy food. 15
    • Delete social media
    • Keep your phone in your bag.
  • Promote health environment
    • Surround yourself with people who have similar goals.

Goal setting

  • Specific goals: you should be able to quantify your goals.
  • Goal visualization: visualize the result of achieving a goal and then think of its obstacles.
  • Goal planning: if-then plans. 16

My personal life

After 4 weeks of implementing multiple strategies from the course, my happiness score increases by 6%.

At the end of 2021, my score went up by 9%.

In the beginning, I wanted to do the gratitude exercise daily, but I skipped multiple days in a row because life happened. However I don't particularly feel bad about it, I did the best that I could, it wasn't consistent but I believe 2-3 missed days out of a week is ok.

I started working out more and I adjusted my daily meals (eating more fishes, veggies, fruits and less meat). I still regularly buy snacks but I keep them in closed cupboard instead of leaving them on kitchen table.

My to do list was reorganized to make items more actionable and the goals more realistic. I have steadily completed tasks, the pace is slow and I wish I could be faster, but I am making progress.

A month is a long time and a lot happened, some are good while some are bad. I'm a bit more aware of my internal feelings and I'm still trying to figure out how to process them.

Overall, looking back, it makes sense that every little thing adds up and I am a bit happier now. I know happiness is fleeting so I need to remind myself every now and again to re-read this page.

My strengths

  • Humility
  • Prudence
  • Honesty
  • Love of learning
  • Judgement

1

Even if I'm familiar with the Müller-Lyer illusion, my vision and my mind still tells me that the 2nd line is longer.

2

Gilbert et al (1998). Immune neglect: A source of durability bias in affective forecasting. Journal of Personality and Social Psychology, 75, 617-638.

3

Kahneman & Deaton (2010). High income improves evaluation of life but not emotional well-being. PNAS, 107(38), 16489-16493.

5

Lucas et al. (2003). Reexamining Adaptation and the Set Point Model of Happiness: Reactions to Changes in Marital Status. Journal of Personality and Social Psychology, 84(3), 527-539.

6

Lyubomirsky (2007). The How of Happiness: A New Approach to Getting the Life You Want. New York, NY: Penguin Books.

7

Van Praag and Frijters (1999). The measurement of welfare and well-being: the Leyden approach. In Well-Being: The foundation of hedonic psychology. New York: Russel Sage Foundation. Pages 413-433.

8

Clark (2003). Unemployment as a social norm: Psychological evidence from panel data. Journal of Labor Economics, 21(2), 323-351.

10

Dunn et al. (2008). Spending money on others promotes happiness. Science,319 (5870), 1687-1688.

11

Epley & Schroeder (2014). Mistakenly seeking solitude. Journal of Experimental Psychology: General, 143(5), 1980.

12

Killingsworth & Gilbert (2010). A wandering mind is an unhappy mind. Science, 330(6006), 932–932.

13

Brewer et al. (2011). Meditation experience is associated with differences in default mode network activity and connectivity. Proceedings of the National Academy of Sciences of the United States of America, 108(50), 20254-20259.

14

Fredrickson et al. (2008). Open hearts build lives: positive emotions, induced through loving-kindness meditation, build consequential personal resources. Journal of personality and social psychology, 95(5), 1045-1062.

15

Wansink et al. (2006). The office candy dish: proximity’s influence on estimated and actual consumption. International Journal of Obesity, 30, 871–875.

16

Gollwitzer & Brandstätter (1997). Implementation intentions and effective goal pursuit. Journal of Personality and Social Psychology, 73(1), 186-199.

Money

I'm working on developing a healthy relationship with money.

Books

Investment

Financial Responsibility

I've a separate retirement account and a fun Robinhood account. The former contains boring ETFs and bonds. As for the latter, I'm mentally prepared for the worst scenario of going to zero.

These days I'm hand off with my accounts, all transactions are for rebalancing portfolio.

Lessons

  • Follow The wheel strategy loosely. Roll for credit (never debit) or let the shares be called. If opportunity cost is great, let shares be called and use the funds for other plays. Rolling means closing a position and opening a new one; they are independent plays.
  • There'll also be ups and downs. As long as I manage my risks properly, I hopefully can live to fight another day.
  • It isn't worth it to do this full time; the profit is below minimum wage.

Plays

Beware: Survivor Bias belows.

These aren't investments, they're pure speculation at best and gambling at worst.

UPRO/TMF 55/45

I came across this while browsing reddit; it was originally posted at bogleheads.

I invested all of my fun account into this play at the beginning of 2020. In March 2020, it was down by 30%. Luckily I didn't abandon the strategy, I rebalanced during that time, sold TMF and bought UPRO. It recovered in 2021, but went down heavily again in 2022. As of today, August 2022, it's down by 12%.

Retirement

The planned portfolio allocation is 55% VTI, 25% VEU, 15% BND and 5% cash.

I use SPY and VTI, VEU and VXUS, BND and AGG for tax-loss harvesting. The portfolio became a bit complicated as I shuffled funds around to realize loss. As of now August 2022, I finally got it back to only VTI, VXUS and BND.

Crypto

Browser

I used Brave browser for over 9 months and got almost 40 BAT tokens (~$20).

It was a novel experience at first, getting paid for viewing ads. However, the payout wasn't great, and my tax return got more complicated this year due to the earning in crypto. I also didn't want to get distracted whenever I used browser.

I could turn off the crypto feature in Brave, but then there wasn't any reason to use Brave over Chrome or Firefox. After all, it was the crypto feature that attracted me to try the browser.

In the end, I switched back to regular old Firefox.

Broker

I have an account with Gemini. When Gemini was paying 8% APY to hold GUSD stablecoin, I deposited some money to test the water. It had been a great experience without any issue.

However, due to multiple recent bankruptcies in crypto world and the cut in interest rate, I had withdrawn my money out of Gemini.

Staking

For some cryptos, a new transaction is validated either by mining or staking.

Let's use an example to explain staking, I hold some tokens in ABC exchange. ABC can use my and other customers' holdings to validate a new block. If ABC is chosen by the network, and they successfully create the block, ABC will distribute the rewards to individuals.

This is similar to a saving account where I hold my money in an account and the bank will pay me a small interest. Saving account is safer because it is insured. In the worst case that the bank goes out of business, I can still get my money back.

As far as I know, there is no insurance for cryptos, which explains the higher staking rewards.

Credit cards

I pay balances in full every month and try not to inflate my lifestyle.

Rent

I've been using Bilt credit card to pay monthly rent for almost a year. So far everything has been working great, except the Android app doesn't support LineageOS 19.1. I can use the website to pay, so it isn't a major problem.

$1 in rent is 1 point and I believe 1 point is ¢1.5, so roughly 1% cash back. It isn't much, but it's better than nothing with ACH.

The catch is that they require 5 monthly non-rent transactions to qualify for the rental points. Topping up Amazon balance with ¢50 5 times qualify as valid transactions.

Foreign transactions

I have a card with no foreign fee to pay foreign purchases.


created: 2022-08-22 updated: 2022-09-10

Carbon Offset

Ideas

  • Produces CO2.
  • Offset by:
    • Planting trees.
    • Building renewable energy generators to replace fossil fuel.
    • Buying carbon offset from the market.

Additionality

Carbon offset needs to be additional to already existing reduction efforts. If I'm required by law to plant a tree, I can't sell this to another entity as carbon offset because it isn't additional.

Proof and verify

Shaky, causing more harm than good.


References


Tags

  • [[Environment ]]

created: 2022-09-10 updated: 2022-09-10

Stable Diffusion

Impressions

I found and read an article about using AI for drawing. It piques my interest, so I decide to give it a try.

I don't know much about the theory or implementation of model training.

Setup

Test runs

I draw this: picture

Run this script:

python optimizedSD\optimized_img2img.py --init-img C:\Users\V\Pictures\draft.png --strength 0.8 --n_samples 5 --H 512 --W 512 --n_iter 1 --precision full --prompt "A tree. A pond with 2 fishes. Cloudy sky at sunrise. Raining. Hyper realistic."

I got back these:

1 2 3 4 5

They are clearly better than my drawing, but not as good as examples I found on the internet.


References


Tags

  • [[Machine Learning]]
  • [[Drawing]]