Snippet for ~/.bash_profile, adding hostname autocomplete to ssh.
Extracts host hints from both ~/.ssh/config and /etc/hosts.
function __completeSSHHosts {
COMPREPLY=()
local currentWord=${COMP_WORDS[COMP_CWORD]}
local completeHosts=$(| require 'openssl' | |
| key = OpenSSL::PKey::RSA.new(2048) | |
| p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) | |
| p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) |
| import pandas as pd | |
| import folium | |
| # edit this section to project the polygon that you want | |
| pj_geojson = {"type":"Polygon","coordinates":[[[101.6637271,3.070996],[101.6637271,3.204971],[101.5526301,3.204971],[101.5526301,3.070996],[101.6637271,3.070996]]]} | |
| subang_jaya = {"type":"Polygon","coordinates":[[[101.6210431,3.085025],[101.6210431,2.975538],[101.5493918,2.975538],[101.5493918,3.085025],[101.6210431,3.085025]]]} | |
| langat = {"type":"Polygon","coordinates":[[[101.6828061,2.643176],[101.6828061,2.9793898],[101.2863841,2.9793898],[101.2863841,2.643176],[101.6828061,2.643176]]]} | |
| boundary = pj_geojson['coordinates'][0] | |
| boundary2 = subang_jaya['coordinates'][0] |
Steps:
openssl version 1.0.2. As openssl v1.0.2 is no longer available, I have extracted openssl v1.0.2 and make it available at https://github.com/khun84/homebrew-repo/brew uninstall --force --ignore-dependencies openssl
brew install khun84/homebrew-repo/openssl
brew cleanup # in case it fails due to permission denied, it can be due to the symlink to be removed is pointing to a non-exist file/directory. Just create the corresponding file or directory and run this command againpkg-config --libs openssl. You should see something like -L/usr/local/Cellar/openssl/1.0.2t/lib -lssl -lcryptoSomewhat helpful link: https://developers.google.com/api-client-library/ruby/
Go to: https://console.developers.google.com/iam-admin/projects
Click "+Create Project"
Enter a "Project name" and "Project ID" and click "Create"
Under "Library" select "Calendar API"
Click ">Enable"
Return to: https://console.developers.google.com/iam-admin/projects
Click "Service Accounts"
| filepath = 'local-filepath' | |
| url = 'web-url' | |
| File.open(filepath, 'w') {|f| | |
| block = proc { |response| | |
| response.read_body do |chunk| | |
| puts "Working on response" | |
| f.write chunk | |
| end | |
| } | |
| RestClient::Request.new(method: :get, url: url, block_response: block).execute |
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
openjdk is keg-only, which means it was not symlinked into /usr/local,
because it shadows the macOS `java` wrapper.
If you need to have openjdk first in your PATH run:
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> /Users/Daniel/.bash_profileIf bump into errors similar to the following during apt install
Preparing to unpack .../libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_i386.deb ...
Unpacking libllvm3.8v4:i386 (1:3.8-2ubuntu3~trusty4) ...
dpkg: error processing archive /var/cache/apt/archives/libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_i386.deb (--unpack):
trying to overwrite '/usr/lib/i386-linux-gnu/libLLVM-3.8.so.1', which is also in package libllvm3.8:i386 1:3.8~+rc3-1~exp1~gd~t
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
The reason of this issue is here => https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
So basically we can just remove the expired cert from the ssl cert file as suggested here => https://www.linuxadictos.com/en/ya-iniciaron-los-problemas-generados-por-el-certificado-dst-root-ca-x3.html
My ssl cert file is located in /etc/ssl/cert.pem. I just need to look for the expired cert and comment it out.
Since Im using ruby 2.3.1 which is using openssl 1.0.2t and I dont want to recompile it, I can use the env var SSL_CERT_FILE to tell which ssl cert i want to use in ruby runtime.