Dark Reader – browser extension easy on the eyes. Literally.

Today’s browser extension suggestion is Dark Reader. This extension turns a web page you’re browsing into a darker version of itself, and does so intelligently in most cases by far.

Dark Reader is an open source browser extension available for: Firefox, Safari, Chrome and Brave. According to the website it “never collected and will never collect any personal data, browsing history etc. ” and it doesn’t introduce any new ads. Since it is an open source project, you can check all these claims for yourself.

To enjoy the new, friendlier surfing for your eyes, you won’t need to bother with any additional tuning in most cases. The text will remain very visible, if not better, the structure of the page will remain the same.

In those rare cases, when the structure isn’t recognized correctly or fitting your desire, you have a bunch of options at your disposal. You can set the contrast, lighter or darker brightness, change the font and gray scale of the page or … you can simply set certain pages to OFF and it will just present the unchanged page to you.

Facebook - Dark Reader ON


FB page looks better to me, blog posts and long passages are easier to read. Below you can see the difference between the original Facebook page (Dark Reader OFF), and Facebook with Dark Reader ON

Another good example of the usefulness of Dark Reader are definitely blogs.

Link: https://darkreader.org

OnionShare: securely & anonymously share a file of ANY SIZE

OnionShare is an open source tool for securely and anonymously sending and receiving files using Tor onion services. It works by starting a web server directly on your computer and making it accessible as an unguessable Tor web address that others can load in Tor Browser to download files from you, or upload files to you. It doesn’t require setting up a separate server, using a third party file-sharing service, or even logging into an account.

Unlike services like email, Google Drive, DropBox, WeTransfer, or nearly any other way people typically send files to each other, when you use OnionShare you don’t give any companies access to the files that you’re sharing. So long as you share the unguessable web address in a secure way (like pasting it in an encrypted messaging app), no one but you and the person you’re sharing with can access the files.

– OnionShare, GitHub page

In this short intro I will just illustrate the very basic use of this tool for you guys.

1) Download & Install

Go to https://onionshare.org/ and download the latest version for your computer. You have a MacOS, Windows and Linux versions to choose from.
After downloading it simply click through installation and you’re ready to run it.

2) Run it

Run by clicking on the OnionShare icon.

You will see a short message saying that it is connecting to Tor network.

And that’s it.

Now you can…

3a) Start sharing files

This is what you’ll be presented with:

OnionShare default window

Simply drag some files you want to securely send to a specific person and drop it to the window:

Then, click Start sharing and…

you will be presented with onion address your friend needs to type in Tor browser or Brave browser (click “New private window with Tor” from the menu and you get Tor capability in Brave).

You can of course also

3b) Receive files

To do that, simply click on “Receive files” and this is what you’ll see:

After clicking “Start Receive mode”…

.. the other party can simply run their Tor browser of Brave (Private browsing with Tor) and start uploading using this simple user interface within browser:

Wish you happy and safe sharing.

Link to my Keybase invitation: keybase.io/inv/f39c332683

Keybase – Secure groups, files, and chat! – 1

This is my opinion the best app[lication] for encrypted communication.

The only drawback is people who haven’t yet installed it which limits their practical use. Well… that and maybe a slightly bit more complicated first setup of the app, but this one is the small price to have it secure.

So.. what does it actually do for us?

Well…a bunch of things, as it turns out!

It’s a communication machine

Main Keybase window – Communication within Teams

You can securely chat user 2 user as in most messenger apps these days and you can create or join secure chat groups as well. All messages have a time-bomb option, and if set they self-destruct after a desired time has passed after which they are gone.

Emoji
Emoji in Keybase’s chat

Chat rooms slightly look like a pimped up IRC client, but with all the goodies included: emojis, file-links, message explosions, search, all in done securely.

Explode message after…

Continue to part 2: Keybase’ Crypto-Wallet

Userful applications

Scoop

What does Scoop do?

Scoop installs programs from the command line with a minimal amount of friction. It tries to eliminate things like:

  • Permission popup windows
  • GUI wizard-style installers
  • Path pollution from installing lots of programs
  • Unexpected side-effects from installing and uninstalling programs
  • The need to find and install dependencies
  • The need to perform extra setup steps to get a working program

Scoop is very scriptable, so you can run repeatable setups to get your environment just the way you like, e.g.:

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

If you’ve built software that you’d like others to use, Scoop is an alternative to building an installer (e.g. MSI or InnoSetup)—you just need to zip your program and provide a JSON manifest that describes how to install it.

Install Scoop

Run this command from your PowerShell to install scoop to its default location (C:Users<user>scoop):

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')


Afterwards you can install most of the tools directly. For example, to install 7zip:

D:>scoop install 7zip

And you’re done.

Install Scoop to a Custom Directory 

If you wanna have Scoop and the installed aplication in a specific directory, power up your PowerShell and type:

[environment]::setEnvironmentVariable('SCOOP','D:ApplicationsScoop','User')
$env:SCOOP='D:ApplicationsScoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Related sites of use:

https://scoop.sh/ 
https://github.com/lukesampson/scoop

AutoHotKey 

https://www.autohotkey.com/
The ultimate automation scripting language for Windows.”

Rapid Environment Editor

https://www.rapidee.com/en/about
Windows environment variables management

Environment variables for Android development

ANDROID_HOME
Deprecated (in Android Studio), use ANDROID_SDK_ROOT instead.

ANDROID_SDK_ROOT

Installation directory of Android SDK package.
Example: C:AndroidSDK or ~/android-sdk/

ANDROID_NDK_ROOT

Installation directory of Android NDK package. (WITHOUT ANY SPACE)
Example: C:AndroidNDK or ~/android-ndk/

ANDROID_SDK_HOME

Location of SDK related data/user files.
Example: C:Users<USERNAME>.android or ~/.android/

ANDROID_EMULATOR_HOME

Location of emulator-specific data files.
Example: C:Users<USERNAME>.android or ~/.android/

ANDROID_AVD_HOME

Location of AVD-specific data files.
Example: C:Users<USERNAME>.androidavd or ~/.android/avd/

JDK_HOME and JAVA_HOME

Installation directory of JDK (aka Java SDK) package.
Note: This is used to run Android Studio(and other Java-based applications). Actually when you run Android Studio, it checks for JDK_HOME then JAVA_HOME environment variables to use.

Log.v(), Log.d(), Log.i(), Log.w() and Log.e() – When to use each one?

I found a wonderful explanation of these on Stackoverflow and I stole them from Kurtis Nusbaum so you won’t have to.

You’re welcome!

So… you come to me and ask:

When and which one to use?

Let me (that is… him) tell you what I stole:

  • Log.e: This is for when bad stuff happens. Use this tag in places like inside a catch statment. You know that an error has occurred and therefore you’re logging an error.
  • Log.w: Use this when you suspect something shady is going on. You may not be completely in full on error mode, but maybe you recovered from some unexpected behavior. Basically, use this to log stuff you didn’t expect to happen but isn’t necessarily an error. Kind of like a “hey, this happened, and it’s weird, we should look into it.”
  • Log.i: Use this to post useful information to the log. For example: that you have successfully connected to a server. Basically use it to report successes.
  • Log.d: Use this for debugging purposes. If you want to print out a bunch of messages so you can log the exact flow of your program, use this. If you want to keep a log of variable values, use this.
  • Log.v: Use this when you want to go absolutely nuts with your logging. If for some reason you’ve decided to log every little thing in a particular part of your app, use the Log.v tag. 

And as a bonus…
Log.wtf: Use this when stuff goes absolutely, horribly, holy-crap wrong. You know those catch blocks where you’re catching errors that you never should get…yea, if you wanna log them use Log.wtf

Git vejenje za budale (Git branching for schmucks)

<Slovenian language>

Ker je za delo (tudi samostojno delo!) branching tako zelo uporabna metoda sem se odločil , da spišem tale kratek potek dela.

Teorija gre nekako tako:

Programer se loti nekega spreminjanja kode za katerega pa ne ve, če bo sploh uporaben. Recimo, da hočete v vaš program dodati možnost izvoza podatkov v Libre Office.
Zato namesto da pišete v MASTER repo raje naredi novo vejo (branch), ki jo poimenuje po spremembi, ki jo želiote izvesti. Torej nekako tako:

Git checkout -b libreOffice

-b je za branch

V ukazni lupini boste zaznali spremembo:
namesto npr:


Hoornet@prostitute /c/Delo/MyWorkDir (master)

Bo sedaj


Hoornet@prostitute /c/Delo/MyWorkDir (libreOffice)

Git vam tako sporoča na kateri veji se trenutno nahajate. Preskok je u šubu. Pri kreaciji nove veje to pomeni, da imate še vedno na voljo vso kodo od prej a lahko sedaj bolj ziheraško spreminjate kodo, saj manipulerate drugo vejo. V kateremkoli trenutku se lahko vrnete na prejšnje satanje.
Ko ste končali s ‘pod-projektom’ se odločite ali boste prelili spremembe v master ali ne. V primeru da je šlo vse ok delujte tako:

Najprej skočite nazaj na master z


Git checkout  master

V trenutku boste nazaj v stanju pred vsemi spremmbami (t.j. v zadnjem stanju pred skokom v novo vejo). Sedaj lahko v master (t.j. v vejo v kateri se trenutno nahajate) zmixate prej ustvarjeno vejo z:


Git merge libreOffice

S tem ukazom ste vse spremembe, ki ste jih ustvarili v novi veji z imenom libreOffice zlili skupaj v default vejo (master).

Če hočete lahko sedaj pobrišete odrabljeno vejo z


Git branch -d libreOffice

Lahko pa jo seveda pustite pri meru za eventualno vrnitev?! Eh! niti ne 🙂

</Slovenian language>

Live templates for Android Studio 2 – Cheat sheet

Hello, my two visitors and hello Google crawler!

While this is my first post (and possibly the only one, unless some miracle happens) so I should introduce my self…
Nah! You can manage without it, I’m sure!

So this is it – short and …well…just short!

At the top are those live templates, that are most important to me personally – the rest follow later.

Loggers:


Log.d(TAG, String)

logd
android.util.Log.d(TAG, "$METHOD_NAME$: $content$");

Log.e(TAG, String, Exception)

loge

android.util.Log.e(TAG, "$METHOD_NAME$: $content$", $exception$);


Android:


Define android style int constant

const
private static final int $name$ = $value$;

Create a new Toast

Toast
android.widget.Toast.makeText(
$className$.this, "$text$"Toast.LENGTH_SHORT).show();

findViewById with cast

fbc
($cast$) findViewById(R.id.$resId$);

get a String from resources

rgS
$resources$.getString(R.string.$stringId$)

——–

Key for a bundle

key
private static final String KEY_$value$ = "$value$";

String format

Sfmt
String.format("$string$", $params$);

Create a for each loop

foreach
for ($i$ : $data$) {
$cursor$
}

Set view visibility to GONE

gone
$VIEW$.setVisibility(android.view.View.GONE);

Set view visibility to VISIBLE

visible
$VIEW$.setVisibility(View.VISIBLE);

Creates an Intent with ACTION_VIEW

IntentView
android.content.Intent view = new Intent();
view.setAction(Intent.ACTION_VIEW);
view.setData(android.net.Uri.parse($url$));
startActivity(view);

create a new Fragment instance with arguments

newInstance
public static $fragment$ newInstance($args$) {
$nullChecks$
android.os.Bundle args = new Bundle();
$addArgs$
$fragment$ fragment = new $fragment$();
fragment.setArguments(args);
return fragment;
}

private empty constructor to prohibit instance creation

noInstance
private $class$() {
//no instance}

runOnUIThread

rouiT
getActivity().runOnUiThread(new java.lang.Runnable() {
@Override
public void run() {
$cursor$
}
});

Creates a static start(…) helper method to start an Activity

starter
public static void start(android.content.Context context) {
android.content.Intent starter =
new Intent(context,
$ACTIVITY$.class);
    starter.putExtra($CURSOR$);    
context.startActivity(starter);
}

Adds generic view constructors

ViewConstructors
public $class$(android.content.Context context) {
this(context, null);
}
public $class$(Context context, android.util.AttributeSet attrs) {
this(context, attrs, 0);
}
public $class$(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);  
$cursor$
}

Git ‘vejenje’ (git branching)

Ker je za delo (tudi samostojno delo!) branching tako zelo uporabna metoda sem se odločil , da spišem tale kratek potek dela.
Teorija gre tako:
Programer se loti nekega spreminjanja kode za katerega pa ne ve, če bo sploh uporaben. Recimo, da hočete v vaš program dodati možnost izvoza podatkov v Libre Office.
Zato namesto da pišete v MASTER repo raje naredi novo vejo (branch), ki jo poimenuje po spremembi, ki jo želiote izvesti. Torej nekako tako:
Git checkout -b libreOffice
-b je za branch

V ukazni lupini boste zaznali spremembo:
namesto npr:
Hoornet@prostitute /c/Delo/MyWorkDir (master)
Bo sedaj 
Hoornet@prostitute /c/Delo/MyWorkDir (libreOffice)
Git vam tako sporoča na kateri veji se trenutno nahajate. Preskok je u šubu. Pri kreaciji nove veje to pomeni, da imate še vedno na voljo vso kodo od prej a lahko sedaj bolj ziheraško spreminjate kodo, saj manipulerate drugo vejo. V kateremkoli trenutku se lahko vrnete na prejšnje satanje.
Ko ste končali s ‘pod-projektom’ se odločite ali boste prelili spremembe v master ali ne. V primeru da je šlo vse ok delujte tako:
Najprej skočite nazaj na master z 
Git checkout  master
V trenutku boste nazaj v stanju pred vsemi spremmbami (t.j. v zadnjem stanju pred skokom v novo vejo). Sedaj lahko v master (t.j. v vejo v kateri se trenutno nahajate) zmixate prej ustvarjeno vejo z:
Git merge libreOffice
S tem ukazom ste vse spremembe, ki ste jih ustvarili v novi veji z imenom libreOffice zlili skupaj v default vejo (master).
Če hočete lahko sedaj pobrišete odrabljeno vejo z 
Git branch -d libreOffice
Lahko pa jo seveda pustite pri meru za eventualno vrnitev?! Eh! niti ne 🙂 Rape its ass out