Formatting the Drive
BTRFS Subvolumes and Mounting
EXT4 Mounting
XFS Mounting
Mounting Boot and setting up FSTAB
Setting Timezone and Locales
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working on Android phones can be quite interesting. | |
Recently I've had opportunities that required me to work on more advanced features of Android OS apart from the more common create app featurs that rely on pre-created with specified and well supported libraries e.g Jetpack Compose. | |
A common problem that many will face as they work on the Android phones, is starting an service on boot complete. | |
I will skip the process of implementing the broadcast receiver class and the manifest declaration. | |
Main point for this gist is to provide my finding based on the research I have done amd make another developers life easier, I mean, we stand on the shoulders of those that came before us. | |
Auto-Starting apps is not very easy for most developers, further, most OEMs make it quite difficult to find the setting manually. Asking the user to navigate to settings and do the work for you is quite a douting task. |
Testing Sound Cards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\Log; | |
class LogRoute | |
{ | |
/** |
This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.
Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.
- To set the default boot mode to Safe Mode, use
msconfig.exe
or open an admin cmd/PowerShell window and run:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* getRandomWeightedElement() | |
* Utility function for getting random values with weighting. | |
* Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50) | |
* An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%. | |
* The return value is the array key, A, B, or C in this case. Note that the values assigned | |
* do not have to be percentages. The values are simply relative to each other. If one value | |
* weight was 2, and the other weight of 1, the value with the weight of 2 has about a 66% | |
* chance of being selected. Also note that weights should be integers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zip = new JSZip(); | |
var count = 0; | |
var zipFilename = "zipFilename.zip"; | |
var urls = [ | |
'http://image-url-1', | |
'http://image-url-2', | |
'http://image-url-3' | |
]; | |
urls.forEach(function(url){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
/** | |
* This script check how PHP makes HTTPS (SSL/TLS) requests using PHP Streams | |
* or cURL. Configuration options are passed as GET parameters, for example: | |
* http://localhost/checksslcontext.php?reconfigure=1 | |
* | |
* Configuration: | |
* http://localhost/checksslcontext.php | |
* Basic PHP Streams using file_get_contents(). Default settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command. | |
socat TCP-LISTEN:8080 stdout | |
#use remotly a command shell | |
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt' | |
#sslify a server | |
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok) | |
Version: 0.1.7 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.1.7 2015-09-01 regex fix for PHP7 phpinfo | |
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter |
NewerOlder