Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.
SSH to your Windows host (SSH Server must be installed in Windows Features)
ssh user@windowshost| #include <time.h> | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <sys/random.h> | |
| #define UUID_T_LENGTH (16) | |
| #define UNIX_TS_LENGTH (6) |
In JavaScript projects, I used to use dotenv so that I could put local environment variables in a .env file for local development. But dotenv requires you to add code to your project.
With direnv, you can put local env vars in a .envrc file and those env vars are loaded automatically in the shell.
For these steps, it is assummed that you have installed Git Bash on Windows. I also use VSCode as my editor.
c:\tools to put the direnv.exe file and add it to the Windows PATH| export HADOOP_HOME=/Users/username/Tools/hadoop-3.1.0 | |
| export PATH=$PATH:$HADOOP_HOME/bin | |
| export PATH=$PATH:$HADOOP_HOME/sbin | |
| alias hstart=$HADOOP_HOME/sbin/start-all.sh | |
| alias hstop=$HADOOP_HOME/sbin/stop-all.sh | |
| export HIVE_HOME=/Users/username/Tools/apache-hive-2.3.3-bin | |
| export PATH=$PATH:$HIVE_HOME/bin |
There are multiple posts (old and new) with instructions on how to generate a fat jar, this is, a jar file for your application
containing also your application's dependencies. Most solutions I have tried did not work for me, even in a simple Hello World
java application, but I have found one that seems to work as expected.
Here it is:
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
| .data | |
| prompt: .asciiz "Encrypt(E) or Decrypt(D) ?" | |
| indata: .space 20 | |
| plaintext: .asciiz "Enter Plain text: " | |
| ciphertext: .asciiz "Enter Cipher text: " | |
| data: .space 40 | |
| Key: .asciiz "Key ?" | |
| WrongKeyword: .asciiz "\nPlease enter a valid character" | |
| .text | |
| main: |
| # | |
| # https://help.github.com/articles/dealing-with-line-endings/ | |
| # | |
| # These are explicitly windows files and should use crlf | |
| *.bat text eol=crlf |
| def modular_sqrt(a, p): | |
| def legendre_symbol(a, p): | |
| """ Compute the Legendre symbol a|p using | |
| Euler's criterion. p is a prime, a is | |
| relatively prime to p (if p divides | |
| a, then a|p = 0) | |
| Returns 1 if a has a square root modulo | |
| p, -1 otherwise. |
| # Basics of Elliptic Curve Cryptography implementation on Python | |
| import collections | |
| def inv(n, q): | |
| """div on PN modulo a/b mod q as a * inv(b, q) mod q | |
| >>> assert n * inv(n, q) % q == 1 | |
| """ | |
| for i in range(q): | |
| if (n * i) % q == 1: |