Skip to content

Instantly share code, notes, and snippets.

View aameralduais's full-sized avatar
😁
Happily coding!

Aamer Alduais aameralduais

😁
Happily coding!
  • Sana'a, Yemen
View GitHub Profile
@aameralduais
aameralduais / config.md
Created September 7, 2018 22:51 — forked from 0XDE57/config.md
Firefox about:config privacy settings

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".

/*
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 March 27, 2019 16:17 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
### 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 / README.md
Created April 20, 2018 08:30 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@aameralduais
aameralduais / Ubuntu_1604_flectra_1_0_installation.sh
Created April 18, 2018 07:35
Install Flectra 1.0 On Ubuntu 16.04 LTS
#!/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 April 13, 2018 12:47 — forked from magnusbae/remove-win-10-apps.md
How to remove Windows 10 Apps (eg. "Photos")

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 January 18, 2018 20:44 — forked from BravoTango86/OtpAuthenticator.cs
C# OTP Implementation with TOTP and HOTP
/*
* 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 October 11, 2017 08:42 — forked from Elements-/pngHeaderInformation.js
Get PNG header information from an image (width, height, bit depth, and color type)
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 October 11, 2017 08:40 — forked from Elements-/getMP4Length.js
Read the duration of a mp4 file nodejs
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);