• Jharkhand Task List

    Photo of a task list written by a girl in Jharkhand

    Some of you may know that I have spent the last 9 years or so working to support children's education in Jharkhand, India. In better times I visit them 2-3x a year. I want to share something that stuck with me the last time I went: one of the girls we work with showed us their daily schedule.

    Tribal Jharkhand girl's daily schedule (24 January 2019):

    At home

    • Keep house clean, 30 min
    • Help mother in her work, 30 min
    • Wash my own school dress, 15 min
    • Help my sister in her studies, 1 hour
    • I have to found (sic) my socks, 20 hours
    • Wash utensils used by me, 5 min
    • Put my bags, school dresses in appropriate places, 10 min
    • Use Whatsapp to write all the notes I have missed as I am not in class today, 2 hours
    • I have to call my grandmother as she is sick, 20 minutes

    Elsewhere

    • School time, 5 hours
    • Tuition time, 1 hour
    • Study for approximately 3 hours a day

    I am nowhere as organized, or as funny, as this girl.

    Going to Jharkhand twice a year has always been the highlight of my year. I'm glad to report that the girls are well, as are their families, which is an amazing outcome in spite of the current COVID-19 situation there. I've seen them grow up over the years: they are absolutely committed to wanting a better life for themselves and their families, and hopefully through the work that I facilitate there I can help to open some doors. If you pay tax in India, you are welcome to make a contribution to the team (other options coming, in the.. future. Overseas contributions are very difficult). The local team is amazing and I am so glad to be able to support this work.

  • Backing up iCloud Photos in the command line

    I have been on a roll of late with my data liberation project.

    The last piece in my photo liberation project was to figure out a way to take out all of the data from iCloud. Having been in the Apple walled garden for more than a decade and a half now, I have.. a lot of stuff in there.

    Apple's official documentation simply says "log in to icloud.com, select the photos you want and download as a zip". What if you've got tens of thousands, or hundreds of photos like me?

    Enter iCloud Photos Downloader, a Python utility that sucks out all of your iCloud photos into wherever you're running it.

    In my case, I've already got a Linux server going for my photos so that's where I wanted it. The eventual goal is to put all of the photos into PhotoPrism there, as I like its tagging and deduping functionality. The goal is for all of my photos to eventually live on photos.mydomain.com, which is where all photos are going to.. eventually. Right now, I've only got my Google Photos in there. Time to get my iCloud photos in there as well.

    Install iCloud Photos Downloader in your server or other computer

    In my case, I just did a git clone of [this repo] into my Linux server. Once downloaded, i cd-ed into it and ran the following command:

    $ pip install icloudpd
    $ pip install -r requirements.txt
    

    As with any other pip package, there can be errors because of your Python environment. I ran into a problem with having too many Pythons, and I could not run the ./icloudpd.py script, which threw a Python module error.

    To fix this, I opened icloudpd.py in a text editor and I edited the first line from: #!/usr/bin/env python to #!/usr/bin/env python3. This tool needs Python 3.6+ to run.

    Starting the download process

    On my Linux server, I created a directory for my photos called icloudphotos.

    I then ran the command:

    icloudpd --directory ~/icloudphotos \
    --username myemail@domain.com \
    --password password
    

    The tool will prompt you to login and authenticate to iCloud.

    Note: if you have 2FA enabled, you will most likely have to re-authenticate every 90 days or so.

    I got tens of thousands of photos as expected. The tool shows you a nice little progress bar with basic information. It ran for several hours (around 5 or 6?) but it really depends on your connection speeds. You can turn off video downloads by using the --skip-videos option. You can also have it email you when it's done by using the various smtp options, but I did not want to bother with that.

    Running icloudpd as a cron script

    The next step in my workflow will be to run this as a cron script. It looks straightforward enough.

    Final thoughts

    I also have Syncthing set up and I am evaluating which workflow I prefer. I might want to continue keeping a copy of all photos on both iCloud and on PhotoPrism for redundancy.

    In any case, I'm glad to have found a non-GUI way to access my iCloud photos. This will make any projects in this category much easier from now on.

  • Schrödinger's Lesbian

    In 2018 I decided to leave my home country of Singapore even though I once thought I would lead my queer adult life here because it was not a bad one. I decided to leave because I had met the woman I would marry, and there was simply no path for us to lead the sort of life we wanted in both of our home countries.

    Being queer in Singapore is strange because on some level, it's one of the better places to be queer in Asia. And on many other fronts, while it isn't quite the worst, it's also.. not at all fun.

    Some time between 2012 (when I returned to Singapore) and 2018 (when I left again) civil society, and the state of queerness in the country, had a certain amount of momentum that made me feel cautiously optimistic. I am now of the opinion that that moment has passed.

    The 'fun' bits about being queer here are:

    • If you have a certain amount of money and class privilege, your life will be virtually indistinguishable from any other queer life you might lead in a major Western city
    • If you have a partner who is either a professional in the right industries, or also a Singaporean or someone who has the right to reside here regardless of your marital status or sexual orientation, you will have a pretty decent life
    • If you are important enough and your partner has the 'right background', there are 'case-by-case' ways to continue to lead a life in Singapore in important jobs and special privileges
    • Homophobia exists at all levels of society but is virtually invisible in the upper echelons of English-speaking, cosmopolitan, world-traveling, Bali-on-the-weekends Singaporean and Singapore expat circles
    • Dating opportunities, in terms of quantity and quality, is just as good as most major Western cities
    • If your partner is also Singaporean, and you're both above 35, you can technically purchase a subsidized public housing flat together under the Singles Scheme
    • The lifestyle is nothing to complain about (but only of course if all of the above apply to you)

    The not-so-fun bits:

    • All of those things have to apply for it to be fun
    • You will have zero legal rights forever
    • The state of LGBTQ rights has not only stagnated, it is probably going backwards (significantly)
    • Every interaction you have with the state as a queer person is an edge case

    One in four heterosexual marriages are between a Singaporean and a non-citizen. We are a city-state, an entrepôt city, a trading post, midway between the world and back. It makes sense that would be the case. There aren't any official numbers, since there's no offical recognition of queer relationships, but an anecdotal guess would rate the share of transnational queer relationships in the LGBTQ world to be even higher than the heterosexual one. We're a global-facing city, after all, and upper-middle class queer Singapore's access to a cosmopolitan dating pool would not be surprising.

    This is where the problem begins.

    Even though the extent of this country's discussion on queer rights at the moment starts with 'should we repeal a Victorian law against sodomy?' and ends with 'what are the gays going to want next? Marriage?', I have been married for 3 years now. I have been leading a regular life in a society where it is so utterly 'normal' that being a cis lesbian is perceived to be regular and boring and not at all revolutionary in any way. I go anywhere, and old Asian ladies talk excitedly about how cute my wife and I are, and express outrage at why we can't lead a regular life in Singapore, where we want to be.

    How does one come back to... this?

    I miss, so much, the heat, the humidity, the potential Bali weekend trips, the well-paid tech jobs in senior roles with far, far lower taxes, the quality of housing, the presence of a washer in every apartment, the public transit, the.. the everything. Nobody should ever have to leave home just to be able to be who you are. And yet, for queer people, leaving is not only about visas. It's about a place to catch your breath because you're just been sprinting and jumping over hurdles your entire life, only to find out that everyone else got to the finish line without a potato sack tied to their foot.

    Being queer in Singapore is about having a potato sack tied to your foot. Some people, people like me, who have the above-mentioned privilege, think for some time that you can get away with whatever life throws at you because you're used to winning the race anyway. But at some point you wonder why you had to win anything at all.

    Today, I was reminded of this fact. We were at a government office trying to get something done, something extremely innocuous that is granted to any heterosexual Singaporean married to a foreigner. While I appreciate that we eventually got things done, every moment is one of debilitating terror. Knowing that what's ahead of you is entirely 'case-by-case', that it depends on the beliefs and the feelings of the people you transact with, wondering if.. perhaps I had shown up as the director of a Singapore company (which I am) and not as the spouse of a foreigner (which I also am), I would have gotten this task done much faster without any questions.

    On top of questions, there's also the indignity of having your marital status yelled out loud in several languages, as if they'd never heard of such a thing.

    I feel like Schrödinger's Lesbian: I am at once a lesbian and not. I am married, there is no question about it, but that marriage does not exist, at the same time. If I were to be hit by a car tomorrow, and die, not only would my wife not be able to come to collect my body, she would also not receive a single cent from me. My sexual orientation matters, because the state does not want me to be visible or loud about it, but it matters as well, because the state also wants you to believe they are the best society in Asia for someone to be queer in, that there is utterly and totally no discrimination at all.

    A few years ago I was interviewed by a local newspaper about my 'unconventional marriage'. Not only was the focus of the story that I was so unconventional we had to leave the country, I spent the entire interview talking about insurance. Insurance excited me greatly. Not only because insurance is essential in healthcare-terrible America, but also because the very boring, blasé act of naming a person you're married to as your next-of-kin is so revolutionary where I'm from. Between the quiet moments of our boring life filled with too much fur in our noses, and the indignity of justifying who we are to bureaucrats who think we don't exist because it doesn't say so in the SOP, I'm quite glad to be going back to boring. And fur. Boring fur and furry bores. But there is not a single moment where I wish I did not have to leave my home for it.

  • A unifying theory of Singapore food that ends in a dream

    1. 'Singapore food' is a difficult term. It's hard to put national wrappers around a smorgasbord of different culinary influences. This is why we keep getting into fights about appropriating others' food. Singapore food is Cantonese, Hakka, Hokkien, Hokchiu, Teochew, Malay, Javanese, Sumatran, Tamil, Kerala, Mamak, Punjabi, Bengali, Kristang, Peranakan, Chetty, and many more.

    2. We simply consume some of them more than others, in public; and some are more widely available commercially. Others are largely consumed at home.

    3. The Singapore food popularized by the tourism board, that appears in movies like Crazy Rich Asians, is only one of many types of Singapore food.

    4. When Malaysians say 'it's better in Malaysia', they are usually right, except for when they are referring to dishes that exist in both northern and southern Malaysia. In that case, the Singapore version, usually held up to be the inferior one, is usually only a mirror of the southern Malaysian, usually Teochew, version of that dish. It is not better or worse, it is just different.

    5. As Singapore / Malaysia food gets more popular abroad, especially in the US, we're going to have to be prepared to see it transform in ways that we may not always appreciate. Like ube, kaya and pandan is going to go on a similar journey. I'm no longer personally invested in the idea of everyone eating exactly the same version of the food that I like; it's fine to let kaya and pandan become its own thing elsewhere.

    6. Gula Melaka (obviously not Singapore food, but used extensively in Singapore) is god tier and will become the next big thing in global pastries and dessert, especially in sweet/salty applications like salted caramel.

    7. One of the best aspects of food in Singapore is that many of the world's top food brands already, or will soon, have an outpost here. Some better than others.

    8. The breadth of vegan and meat alternatives in Singapore currently is breathtaking. It's certainly changed in this department since I left home. While I'm not vegan, and likely will never be, I appreciate the options that are available. While one might need to go to a midrange restaurant in San Francisco to have Impossible burgers, there are Impossible burgers in convenience stores here. There are vegan options in a lot of local food now, a lot more than I remember. Pretty much every major plant-based or meat alternative or lab grown company is here with a product out on the market. Way more than in the US. And all in one tiny city. I'm excited to try the vegan sashimi that I just saw, and the vat-grown chicken. This is definitely related to the next section on 'how come I can get all of my favorite food in one city now?'

    A list of foreign food chains I like in Singapore

    Burgers: Shake Shack, Five Guys, Carne

    South Indian: Murugan, Anjappar, Junior Kuppanna, Ponnusamy, Dindigul Thalappakati

    Malaysian Chinese: Go Noodle House, Super chilli pan mee, various Malaysian hawkers at Malaysia Boleh

    Taiwan: Sushiro, Mu:, many many boba / bubble tea chains (most of them in fact)

    China: too many to name, other than Hai Di Lao there are also Chinese chains for specific regional dishes, like more than two famous chains for say, suancai

    Way too many Japanese and Korean chains to list.

    Sure, chain food isn't all that exciting and many of them arrive here in a completely bastardized form especially when they are run by a local F&B group that is less good at running franchises. But the ones run by the owners, like most of the Indian and Malaysian chains, make me very glad to have something I love so much all in once place especially in times like these when I don't think I'll be able to travel to those places for longer than I'd like.

    So why are there so many chains setting up shop here? I suspect capital flight, and the precarious political situation in Hong Kong as a traditional financial hub. It's also incredibly easy to setup a business in Singapore. While there are some problems with that model, you can definitely draw a direct line from the ease of setting up shop to why we have all of these restaurants.

    I love that I can get biryani with seeraga samba rice (the clearly superior rice for biryani) in not just one style, but several: Kongunadu style at Junior Kuppanna, Thalappakati style at Dindugl Thalappakati. I love that I have many, many types of boba to choose from, from hand-brewed tea-forward teas like at Chicha San Sen to black sugar boba abominations with cheese like at Black Sugar or Xing Fu Wang. I love that the noodles I love so much when I lived in KL are mostly here.

    Not forgetting individual chefs or restaurant owners who don't have chains, who have simply moved here and are doing what they do best here. I've had very decent Ipoh horfun and Sarawak kolo mee. I'm really liking the boom in Henghua (xing hua) food, after Putien's success. You find these at tiny restaurants (like Yun Heng) and at food courts (like at Malaysia Boleh). We've also recently found a very-close-to-Village-Park style nasi lemak at Uptown Nasi Lemak, Telok Ayer (which is totally different from Singapore nasi lemak).

    High brow low brow

    I hate it when food writers spend too much time talking about how you can get gasp high end food at low end prices. That, I think, is unique to Singapore in some ways because we have a large number of trained chefs and cooks at the many, many hotels and restaurants; and many of them, like chefs and cooks anywhere, want to do their own thing. Our inventory of non-restaurant space, like at hawker stalls or food courts or commercial shop space below public housing, has made it possible. You have always had things like 'Austrian man sets up sausage stand in Chinatown' or 'Japanese couple selling Singaporean Teochew noodles in hawker centre' in the first wave of that. We've also always had stories of 'hotel chef sets up shop in hawker stall'. So I am not, as a food-obsessed Singaporean, surprised by this sort of thing.

    What this means in daily life, though, now that I live somewhere with with a well-known but very different food scene, is that you can get fancy dimsum in a place like Yishun. You get French-trained chefs cooking Hokkien mee.

    I love that. However, I love more when a new generation of Singaporeans take over, or start, hawker food businesses. It leads to innovations that take the best of our traditions and blends it with our exposure to new things, and makes it entirely new. As a Teochew person, I love braised duck more than.. nearly anything else in the world. A place like Jin Ji where a younger person has started to get involved can now do things like dry duck ramen and still be distinct from when a Japanese ramen master does it. I have never seen duck ramen anywhere else outside of Japan and Singapore and I feel like more people should know that you can have many types of duck ramen in Singapore, including one that is Teochew-inspired.

    On authenticity

    Does this mean that food in Singapore is not authentic? First, I'd like to banish the idea of authenticity. Nothing is authentic, even in the sourcelands. India, China, and other places we draw inspiration from, have all had food that has come from somewhere else, and no food exists in a vacuum.

    But even in the 'authenticity' department we are no slouch. You can get old school Teochew food, you can get traditional East Javanese food (Bebek Goreng Pak Ndut), you can get authentic Kongunadu food (Junior Kuppanna), you can get authentic Chennai style idlis (Murugan). You can get extremely high levels of 'authentic' high end Japanese food for nearly every region, and dish.

    When I think about what I miss most about eating in Singapore, especially when I'm cold and hungry at midnight in San Francisco, it looks a little like this:

    In my eating-in-Singapore dreams, it is always midnight. I am at Mustafa in June fighting over mangoes with aunties. The cashier asks me what's the big deal anyway about these mangoes. I say it's not just a mango, it's dasheri. After losing at mangoes (the aunties always jab me and they get the best ones), I walk to Desker Road for hot garlic cheese naan, dal fry, palak paneer and kadai chicken. Javid offers me a cigarette. I tell him I don't smoke anymore. He says good, have some elaichi chai. In the morning, my mother has made me a tub of Hokkien chicken wings that her mother used to make, for breakfast. There's at least 2 kilos. I love chicken wings. Love is an understatement. When I've had Filipino food, I can see the Hokkien influence in all of the dark soy sauce and garlic. My Hokkien half is satisfied. Later, for lunch, I want a light Teochew porridge with all of the trimmings: steamed pomfret or rabbit fish. Taucheo. Preserved mustard leaves with olives. I walk around in the heat and sweat it all off. For dinner, I can have great sushi or I can have biryani. With seeraga samba, the clearly superior biryani rice. Then I remember a cocktail costs $25 in this city and I wake up.

    So whenever someone not from a major food city moves to San Francisco and says to me, the food scene is so good! I hold my tongue and say... yes, it is, but. I could also be eating in Singapore. In my dreams.

  • How I run PhotoPrism with Docker Compose and reverse proxy

    If you, like me and many others, have started to feel uncomfortable about one company knowing everything about you, moving off the Google ecosystem is the natural first step. There are lots of alternatives for the main features: for search, there is DuckDuckGo, which is improving all the time and has now fully replaced Google search for me. There is Fastmail, Proton Mail and many other alternatives for email. For photos, Google Photos and iCloud Photos reign supreme.

    I have attempted over the last couple of years to move off Google Photos. Each time, I've been let down by problems in bandwidth and download speeds. If you have vast amounts of data, it can get very difficult to work with the raw data you obtain from Google Photos using a graphical user interface. Each time I've tried to do that I've ended up with corrupted files or incomplete data.

    For this reason, I eventually designed this plan.

    PhotoPrism in Docker Compose

    With a reverse proxy into a photos.mydomain.com address and https.

    To be honest, while I know my way around servers I don't have a lot of experience with containers, networking or security. I did not want to attempt this project until I succeeded in getting a beginner's version of all that up online.

    Choice of self-hosted photo software. I looked mostly at PhotoPrism and PhotoStructure. Both of these projects appeared closest to the sort of self-hosted Google Photos-esque application I was looking for. Many other photo projects are far closer to web 1.0 style web galleries. In my case, I had more than a quarter of a million photos and videos strewn across multiple clouds. I have ADHD, and it has been very difficult for me to organize things.. anything.

    Hardware. I decided that I wanted to lease a server in Europe, because there are very good deals to be had there. Hetzner, OVH and an assortment of related companies like SoYouStart, Kimsufi, I've used most of them at various times in the past. It's relatively affordable to get up and running on a server run by any of those companies using used or old parts. For the most part it works out cheaper than trying to own your own hardware right now (in the midst of a global chip and memory shortage). Many people certainly do this sort of work on a NAS or a Raspberry Pi, but I knew I wanted something with many more cores. I got a Xeon E3 server to start, but may upgrade later. $27 a month is not a bad deal at all for a dedicated server with those speces (16GB RAM, relatively decent uplink).

    Source of data, and download method. As mentioned previously, I have not had much luck with retrieving my data from Google in the past. This time, I decided to completely avoid downloading my data to local storage, knowing that even with decent desktops and laptops I would still struggle with handling all of this data. I decided to download the backup files directly into my server instead. I decided to do a Google Takeout of all of my Google Photos from my G-Suite domains (several!) and my personal account's Google Photos. You can do the same by going to the Takeout page. I decided to send Takeout data directly into OneDrive, where I have a temporary premium account solely for this purpose. I've noticed I can fetch data from OneDrive at very high speeds using rclone, at least 2-3x faster than from Dropbox or Google Drive.

    Rclone, a fantastic tool I can't live without. I have been a huge fan of Rclone for a while now. While it works amazingly well for Google Drive and Dropbox, there are known limitations with rclone for extracting and moving Google Photos that I did not want to deal with. Mainly, using rclone for this purpose strips EXIF data, a known limitation of Google Photos' API.

    When my Google Takeout is complete, I rclone to download from OneDrive into my server.

    rclone copy onedrive: servername:/home/username/destination -P

    For a 200GB backup of my Google Photos, Takeout gave me 4 files that were 50GB each. That took rclone around a few minutes to transfer at 80-100MB/s.

    I then unpacked all of the files into a single folder:

    cat *.tgz | tar zxvf - -i

    That gave me a single folder of all of my photos in a folder named Takeout.

    Installing PhotoPrism using Docker Compose. The official Docker Compose instructions are pretty easy to follow. For reference, here's my docker-compose.yml file.

    Accessing your photos using a reverse proxy For security, you don't want to access your self-hosted photos at SOME.IP.XX.XX:PORTNO or yourdomain.com:portno. You'll want to access it at a domain, preferably one you own. This was the hardest part for me: there are many ways to get a reverse proxy going, and I didn't know very much about all of that.

    I decided to use LSIO's swag container. In a nutshell, LSIO provides very well-maintained Docker images for many popular homelab projects. You can easily stand up a wiki, a PVR, or even niche things like a self-hosted Markdown editor. I've used many of their images in other projects and I love how easy it is, how helpful the community is. The swag container was the one I spent the most time on.

    It's helpful to read the docs and initial setup info. Once you figure out the ins and outs of how things are set up in this container, you can easily get https://yourdomain.com, https://anysubdomain.yourdomain.com or even https://yourdomain.com/subfolder up and running. Of all of the 'beginner' methods of learning to set up services with reverse proxies (and there are many: you can use Traefik, Caddy, docker gen, etc), this wound up being the one I felt I learned most quickly.

    In summary, you want to:

    1. Set up DNS
    2. Get an SSL certificate for all your domains and subdomains
    3. Edit the proxy configuration files

    Read the docs, or ask for help; it took me, someone with not a whole lot of infrastructure experience but who knows a bit of Linux, a couple of days to set it up correctly.

    The swag container has many built-in templates that makes this easy, once you learn its quirks.

    Screenshot of PhotoPrism showing lots of dogs in the pictures

    Photoprism has Tensorflow built in. Their pre-trained model doesn't get everything right (for example, it marked a plate of squid as 'baby'), but it is pretty good. My wife is placing a bet with me that I probably have more than 20 000 photos of Cookie. The moment of truth will probably be in a day or so, when all 200 000 ish photos I've got (over the last 20 years) are finally imported, indexed and tagged.

    I was able to set up PhotoPrism in Docker Compose in this manner, and access it at https://photos.mydomain.com. While I'm currently importing and indexing a quarter of a million photos, I've been happy with the speed, performance and features and have decided to sponsor the project. It's nice to see people working on useful software that works well and looks good.

    I'm pretty happy with the progress I've made on this. I might make a tutorial for the more complex parts of this project later.