Skip to content

Instantly share code, notes, and snippets.

View awesome's full-sized avatar

So Awesome Man awesome

View GitHub Profile
@spaze
spaze / opera-vpn.md
Last active April 20, 2024 02:14
Opera VPN behind the curtains is just a proxy, here's how it works

2023 update

ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.

🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.


When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

@mmfilesi
mmfilesi / fruits-components.html
Created March 8, 2016 23:02
how combine polymer with handlebars
<dom-module id="fruit-component">
<template>
<p>color: {{color}}</p>
<button on-tap="setColor">set color in light dom</button>
</template>
<script>
Polymer({
is: 'fruit-component',
module AuthRequestHelper
def http_auth_as(username, password, &block)
@env = {} unless @env
old_auth = @env['HTTP_AUTHORIZATION']
@env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(username, password)
yield block
@env['HTTP_AUTHORIZATION'] = old_auth
end
def auth_get(url, params={}, env={})
@capttaco
capttaco / Fetchable.swift
Last active May 3, 2019 17:28
A utility protocol for custom NSManagedObjects that makes querying contexts simpler and more convenient. Requires Swift 2.
import CoreData
protocol Fetchable
{
typealias FetchableType: NSManagedObject
static func entityName() -> String
static func objectsInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> [FetchableType]
static func singleObjectInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> FetchableType?
static func objectCountInContext(context: NSManagedObjectContext, predicate: NSPredicate?) -> Int
@barroco
barroco / raven-shell
Last active May 4, 2024 11:25
Send Sentry error from shell using curl
#!/bin/sh
SENTRY_KEY=
SENTRY_SECRET=
SENTRY_PROJECTID=1
SENTRY_HOST=sentry.example.com
SCRIPT_ARGUMENTS=$@
capture_error()
{
@anamorph
anamorph / HOWTO Install AWS CLI on Debian.md
Last active July 30, 2022 09:50
HOWTO Install AWS CLI on Debian

HOWTO Install AWS CLI on Debian

1. installing pre-reqs

sudo apt-get install python python-pip

2. installing the cli:

sudo pip install awscli

3. configuring the cli:

aws configure
@eupharis
eupharis / states_by_fips.json
Last active January 19, 2022 19:36
State FIPS JSON (Abbreviation and Name)
{
"01": {
"abbreviation": "AL",
"name": "Alabama"
},
"02": {
"abbreviation": "AK",
"name": "Alaska"
},
"03": {
@joelpittet
joelpittet / .gitconfig
Created March 12, 2015 19:15
kaleidoscope git mergetool config
# Kaleidoscope.app as difftool and mergetool.
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
@panmari
panmari / postgresql_random_retrieve.rb
Last active May 11, 2018 10:59
Benchmark of various methods to retrieve a random record from a table using ActiveRecord and a Postgresql db behind.
require 'benchmark'
# Disable logging if in development/test mode
ActiveRecord::Base.logger = nil
model_name = Icd
N = 100
Benchmark.bm(11) do |x|
x.report('ruby rand') { N.times { model_name.offset(rand(model_name.count)).first } }
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.