Skip to content

Instantly share code, notes, and snippets.

Avatar
😁
Happily coding!

Aamer Alduais aameralduais

😁
Happily coding!
  • Sana'a, Yemen
View GitHub Profile
View SimpleLogger.cs
/*
MIT License
Copyright (c) 2016 Heiswayi Nrird
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@aameralduais
aameralduais / pipenv_cheat_sheet.md
Created Mar 27, 2019 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands
View pipenv_cheat_sheet.md

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@aameralduais
aameralduais / config.md
Created Sep 7, 2018 — forked from 0XDE57/config.md
Firefox about:config privacy settings
View config.md

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

View ssl-create-java-keystore-jks-tomcat.txt
### SSL Part 1: Creating Java SSL KeyStore (JKS)
This is part one of a three-part series on how to configure a single SSL certificate for use on both Tomcat and Apache. I'll take you through creating a new Java KeyStore (JKS), submitting a Certificate Signing Request (CSR), and finally, importing the singed certificate into your KeyStore.
#### 1\. First, create a directory for your SSL files
# sudo mkdir /etc/my_ssl
#### 2\. Now change into that directory
@aameralduais
aameralduais / Ubuntu_1604_flectra_1_0_installation.sh
Created Apr 18, 2018
Install Flectra 1.0 On Ubuntu 16.04 LTS
View Ubuntu_1604_flectra_1_0_installation.sh
#!/bin/bash
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/flectra --gecos 'flectra' --group flectra
sudo mkdir /etc/flectra && sudo mkdir /var/log/flectra/
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install postgresql postgresql-server-dev-9.5 build-essential python3-pillow python3-lxml python-ldap3 python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libsasl2-dev libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev -y
sudo git clone --depth=1 --branch=1.0 https://github.com/flectrahq/flectra.git /opt/flectra/flectra
sudo chown flectra:flectra /opt/flectra/ -R && sudo chown flectra:flectra /var/log/flectra/ -R && cd /opt/flectra/flectra && sudo pip3 install -r requirements.txt
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /tmp && wget https://downloads.wkhtmltopdf.org/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && sudo gdebi -n wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && rm wkhtmltox-0.12.2.1_l
@aameralduais
aameralduais / remove-win-10-apps.md
Created Apr 13, 2018 — forked from magnusbae/remove-win-10-apps.md
How to remove Windows 10 Apps (eg. "Photos")
View remove-win-10-apps.md

How to remove Windows 10 Apps (eg. "Photos")

Open PowerShell (right click > run as Administrator), and enter Get-AppxPackage *photo* | Remove-AppxPackage For other apps just replace "photo" with something else.

If you want to look at the list of installed applications just use Get-AppxPackage, if you want to copy said list into a program better suited for working with text (eg. has search), just type Get-AppxPackage | clip

@aameralduais
aameralduais / OtpAuthenticator.cs
Created Jan 18, 2018 — forked from BravoTango86/OtpAuthenticator.cs
C# OTP Implementation with TOTP and HOTP
View OtpAuthenticator.cs
/*
* Copyright (C) 2016 BravoTango86
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@aameralduais
aameralduais / pngHeaderInformation.js
Created Oct 11, 2017 — forked from Elements-/pngHeaderInformation.js
Get PNG header information from an image (width, height, bit depth, and color type)
View pngHeaderInformation.js
var fs = require('fs');
fs.readFile('test.png', function (err, data) {
var pngHeader = new Buffer([137, 80, 78, 71, 13, 10, 26, 10]);
var header = data.slice(0, 8);
if(header.compare(pngHeader) != 0) {
console.log('Invalid png file header!')
process.exit();
}
var fileHeader = {
@aameralduais
aameralduais / getMP4Length.js
Created Oct 11, 2017 — forked from Elements-/getMP4Length.js
Read the duration of a mp4 file nodejs
View getMP4Length.js
var buff = new Buffer(100);
fs.open(file, 'r', function(err, fd) {
fs.read(fd, buff, 0, 100, 0, function(err, bytesRead, buffer) {
var start = buffer.indexOf(new Buffer('mvhd')) + 17;
var timeScale = buffer.readUInt32BE(start, 4);
var duration = buffer.readUInt32BE(start + 4, 4);
var movieLength = Math.floor(duration/timeScale);
console.log('time scale: ' + timeScale);
console.log('duration: ' + duration);