Skip to content

Instantly share code, notes, and snippets.

View karthiks's full-sized avatar
😄
Playing with GraphQL

Karthik Sirasanagandla karthiks

😄
Playing with GraphQL
View GitHub Profile
@karthiks
karthiks / .sh
Created July 21, 2021 17:47
change ownership of file in ubuntu
chown www-data.www-data /etc/apache2/blacklist
@karthiks
karthiks / nginx
Created December 20, 2020 11:51
default logrotation for nginx located at /etc/logrotate.d/nginx (per app logrotate is configured this way)
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

# Know the id of the username in the original distro that was exported
wsl -d Ubuntu-20.04 -u kartz -e id -u
# Outputs 1000
# Knowing the id of the username in the distro that was created by importing the tar image
wsl -d Ubuntu-20 -u kartz -e id -u
# Outputs 1000
# I would want to use this distroname and id, to set this user as the default login profile of WSL.
# I set this up in Windows Registry with the line snippet below:
[user]
default=my_default_user
@karthiks
karthiks / wsl-cheatsheet.ps1
Last active April 11, 2024 07:39
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name
@karthiks
karthiks / awsamplifyexpo.js
Created September 11, 2020 14:12 — forked from AndrzejKomarnicki/awsamplifyexpo.js
AWS Amplify and AppSync with Expo (React Native) cheat sheet
AWS Amplify and AppSync with Expo (React Native) cheat sheet and reference guide
[AWS Amplify] https://aws-amplify.github.io
[Expo] https://expo.io
// In order to run the Android emulator with Expo you will need Android Studio with Android Virtual Device Manager
// In order to run the iOS simulator with Expo you'll need Xcode
INITIALIZE PROJECT
# Function to change the default user
Function WSL-SetDefaultUser ($distro, $user) { Get-ItemProperty Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\*\ DistributionName | Where-Object -Property DistributionName -eq $distro | Set-ItemProperty -Name DefaultUid -Value ((wsl -d $distro -u $user -e id -u) | Out-String); };
# Usage
# WSL-SetDefaultUser <DistroName> <UserName>
$title = 'WSL Import'
$question = 'The current Ubuntu WSL system will be unregistered, and the new VHD imported. Are you sure you want to proceed?'
$choices = '&Yes', '&No'
$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1)
wsl --export Ubuntu ubuntu.tar
wsl --unregister Ubuntu
wsl --import Ubuntu D:\VMs\WSL\Ubuntu\ ubuntu.tar --version 2
[wsl2]
localhostForwarding=true