Skip to content

Instantly share code, notes, and snippets.

View shurane's full-sized avatar

Ehtesh Choudhury shurane

  • Astoria, NY | Seattle, WA
  • 21:32 (UTC -07:00)
View GitHub Profile
@shcallaway
shcallaway / README.md
Last active April 15, 2024 14:25
Use jq to parse JSON logs into something more readable

Structured logs are way better than normal logs for a whole bunch of reasons, but they can sometimes be a pain to read in the shell. Take this logline for example:

{"erlang_pid":"#PID<0.1584.0>","level":"error","message":"Got error when retry: :econnrefused, will retry after 1535ms. Have retried 2 times, :infinity times left.","module":"","release":"c2ef629cb357c136f529abec997426d6d58de485","timestamp":"2019-12-17T19:22:11.164Z"}

This format is hard for a human to parse. How about this format instead?

error | 2019-12-17T19:21:02.944Z | Got error when retry: :econnrefused, will retry after 1648ms. Have retried 2 times, :infinity times left.
@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active July 10, 2023 14:53 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development

Pixelbook or Pixel Slate Setup

Partly updated June 2023

General caution: Chrome OS is a secure OS by design, but this has at least one key consequence. If you change your Google account password, you will still be required to enter the old password the next time you access each Chrome OS device. Devices are encrypted with that password, so the OS needs to decrypt using the old password then re-encrypt using the new one. If you forget your old password you will lose access to your Chrome OS device data. As always, make sure you keep backups up to date.

Fast User Switching

If you have multiple Chrome OS accounts (Say, work and play), you can quickly sitch between them without logging out:

@ajdruff
ajdruff / fix-git-line-endings
Last active February 29, 2024 13:02
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@mihow
mihow / load_dotenv.sh
Last active April 14, 2024 09:12
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active April 15, 2024 09:03
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@bcoe
bcoe / npm-top.md
Last active March 23, 2024 20:02
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@andre1810
andre1810 / list_vagrant_port_forwardings.rb
Last active April 2, 2021 17:52
List Port Forwardings of vagrant machines
vm_infos = `vboxmanage list vms`
puts 'Port Forwardings:'
puts '---------------------------------'
vm_infos.each_line do |vm_info|
vm_name = vm_info.scan(/\"(.*)\"/)
vm_id = vm_info.scan(/.*{(.*)}/).join('')
vm_detail_info = `vboxmanage showvminfo #{vm_id}`
@etes
etes / pi_mount_usb.md
Last active March 14, 2024 17:31
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@tkrotoff
tkrotoff / RemoveWin10DefaultApps.ps1
Last active April 6, 2024 01:52
Remove Windows 10 default apps
# See Remove default Apps from Windows 10 https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/
# See Debloat Windows 10 https://github.com/W4RH4WK/Debloat-Windows-10
# Command line to list all packages: Get-AppxPackage -AllUsers | Select Name, PackageFullName
Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage
Get-AppxPackage Windows.ContactSupport | Remove-AppxPackage
Get-AppxPackage Microsoft.Xbox* | Remove-AppxPackage
Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage # Mail and Calendar
#Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
Get-AppxPackage Microsoft.WindowsCamera | Remove-AppxPackage