Skip to content

Instantly share code, notes, and snippets.

View hddananjaya's full-sized avatar
⚔️

Akila Dananjaya hddananjaya

⚔️
View GitHub Profile
@hddananjaya
hddananjaya / README._MD
Last active November 13, 2020 01:27
Privacy with GNU Privacy Guard.
gpg2 --symmetric --cipher-algo AES256 -o enc-secrets.zip ./secrets.zip
# remember the password. Never save digitally -
rm -rf ~/.gnupg/
shred --remove secrets.zip
# upload to a cloud service -
shred --remove enc-secrets.zip
@hddananjaya
hddananjaya / WeatherReporter.sh
Last active May 8, 2020 06:08
Fidenz bash challenge.
#!/bin/bash
# WeatherReporter 1.0
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
scriptFile="$scriptDir/$0"
tmpWeatherXMLFile="$scriptDir/sydneyData.xml"
logFile="$scriptDir/weatherReport.log"
tmpCronFile="$scriptDir/cronInfo"
function checkRequiredUtils() {
@hddananjaya
hddananjaya / extract.js
Created May 8, 2020 17:56
Facebook - Extract group users.
var nodes = document.querySelectorAll('[data-name=GroupProfileGridItem]');
var users = [];
for (i of nodes){
var name = i.children[1].children[1].children[0].children[1].children[0].textContent
var profilePic = i.children[0].children[0].src
users.push({name, profilePic});
}
console.log(users)
# in chrome dev tools we can use copy(object) to copy users.
gcloud auth application-default login \
--scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore \
--client-id-file=$(ls client_secret_*.json)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>The Vivlio Daily【Sample Edition】第0042号</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<style>
@charset "UTF-8";
html {