Skip to content

Instantly share code, notes, and snippets.

View esemeniuc's full-sized avatar

Eric Semeniuc esemeniuc

View GitHub Profile
@briangershon
briangershon / solana-anchor-debug-rust.md
Created February 28, 2022 06:47
Solana Anchor: Test and Debug Rust with msg! and program-logs

What if you want to debug the Rust program itself in Anchor?

  1. In Rust, add msg!("Some variable: {:?}", variable);
  2. Run anchor test to run the program through the tests. However you won't find the output there.
  3. View the output instead in a file within your program-logs folder in your Anchor project. It'll be recreated each time you run the program.

This is subtly mentioned in the docs and can be found in the CLI docs here: https://book.anchor-lang.com/chapter_4/cli.html#test

@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.

@learncodeacademy
learncodeacademy / gist:5850f394342a5bfdbfa4
Last active January 7, 2024 11:58
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a