This is an example of Go code calling to a C++ library with a C wrapper.
go build # this only ensures it compiles
const crypto = require('crypto'); | |
const ALGORITHM = 'aes-256-gcm'; | |
class AESGcmNode { | |
constructor(key) { | |
if (key.length < 32) { | |
throw new Error("key len should be 32 byte"); | |
} | |
this.key = Buffer.from(key); |
/bin
(and /sbin
) were intended for programs that needed to be on a small / partition before the larger /usr
, etc. partitions were mounted. These days, it mostly serves as a standard location for key programs like /bin/sh
, although the original intent may still be relevant for e.g. installations on small embedded devices.
/sbin
, as distinct from /bin
, is for system management programs (not normally used by ordinary users) needed before /usr
is mounted.
/usr/bin
is for distribution-managed normal user programs.
There is a /usr/sbin
with the same relationship to /usr/bin
as /sbin
has to /bin
.
/usr/local/bin
is for normal user programs not managed by the distribution package manager, e.g. locally compiled packages. You should not install them into /usr/bin
because future distribution upgrades may modify or delete them without warning.
You need to install paramiko
package
$ pip install paramiko
Install JRE 11
$ sudo apt install openjdk-11-jre-headless
Install Scala 2 https://www.scala-lang.org/download/scala2.html
$ wget https://downloads.lightbend.com/scala/2.13.7/scala-2.13.7.tgz
import ftplib | |
import socket | |
from pathlib import Path | |
class MyFTP_TLS(ftplib.FTP_TLS): | |
"""Explicit FTPS, with shared TLS session""" | |
def ntransfercmd(self, cmd, rest=None): | |
conn, size = ftplib.FTP.ntransfercmd(self, cmd, rest) | |
if self._prot_p: | |
conn = self.context.wrap_socket(conn, |
Generate Private Key
$ openssl genrsa -out private.key 2048
Generate CSR with Private Key and fill the required fields
$ openssl req -new -key private.key -out csr.txt
// wuriyanto | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
//"time" | |
) | |
type Color struct { |
def encode_uint32(n: int): | |
res = [] | |
for i in range(4): | |
r_shift = 24 - 8 * i | |
d = (n >> r_shift) & 0xFF | |
res.append(d) | |
return res | |
def decode_uint32(l: list, order='be'): | |
if order == 'le': |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Println(isOdd(2)) | |
} |