This file contains hidden or 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
# install wget, if missing | |
yum install wget | |
# find a mirror http://isoredirect.centos.org/centos/8/isos/x86_64/CentOS-8-x86_64-1905-dvd1.iso | |
# replace url with your mirror | |
wget http://centos.mirror.constant.com/8.0.1905/isos/x86_64/CentOS-8-x86_64-1905-dvd1.iso | |
# with usb unplugged check for your current devices | |
ls /dev/s* |
This file contains hidden or 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
; SPF (Sender Policy Framework) is an email authentication protocol | |
; that allows the owner of a domain to specify which mail servers they use to send mail from that domain. | |
; | |
; explanation | |
; https://postmarkapp.com/blog/explaining-spf | |
; | |
; mailchimp include:servers.mcsv.net https://mailchimp.com/help/set-up-custom-domain-authentication-dkim-and-spf/ | |
; gmail include:_spf.google.com https://support.google.com/a/answer/33786?hl=en | |
; on-premises mail ip4:x.x.x.x/24 |
This file contains hidden or 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
# add Virtual Box repo | |
sudo dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo | |
sudo rpm --import https://www.virtualbox.org/download/oracle_vbox.asc | |
# install VirtualBox 6 | |
sudo dnf install VirtualBox-6.0 | |
# install depenency to avoid issue running containers | |
sudo dnf install kernel-headers.x86_64 gcc perl make | |
sudo dnf install kernel-devel kernel-devel-4.18.0-80.el8.x86_64 elfutils-libelf-devel.x86_64 |
This file contains hidden or 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
Formula | |
METHOD_NAME = [CONTEXT] + VERB + [HOW] | |
METHOD_NAME | |
Must use camelCase (reference Zend Certificated Engineer study manual, Composer, and PSR standards). | |
Must not start with “__” unless it’s a predefined magic method. | |
Must start with an alphabetical character. | |
CONTEXT | |
Should be a noun. |
This file contains hidden or 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 | |
$uid = 'username'; | |
$password = 'password'; | |
echo 'Try login as uid "' . $uid . '" using password [redacted]<br><br>' . PHP_EOL; | |
// connect | |
$ldapconn = ldap_connect('ldap://ldap.example.com'); | |
if (!$ldapconn) { | |
echo 'Could not connect to authentication server.' . PHP_EOL; |
This file contains hidden or 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
SELECT | |
`mdl_course`.`id` AS `course_id`, | |
`mdl_course`.`shortname` AS `course_name`, | |
`mdl_user`.`email` AS `email_address`, | |
`mdl_user`.`firstname` AS `first_name`, | |
CASE | |
WHEN `mdl_role_assignments`.`roleid` = 1 THEN 'Manager' | |
WHEN `mdl_role_assignments`.`roleid` = 2 THEN 'Course creator' | |
WHEN `mdl_role_assignments`.`roleid` = 3 THEN 'Teacher' | |
WHEN `mdl_role_assignments`.`roleid` = 4 THEN 'Non-editing teacher' |
This file contains hidden or 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
# Generate SSH Key | |
ssh-keygen -o -f ~/.ssh/www.example.com | |
# Add SSH key to your SSH config | |
vim ~/.ssh/config | |
Host www.example.com | |
User git | |
HostName www.example.com | |
IdentityFile ~/.ssh/www.example.com |
This file contains hidden or 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 | |
// save the image locally | |
$image = file_get_contents('http://ipcamera.example.com/oneshotimage'); | |
$datetime = new DateTime(); | |
$filename = $datetime->format('Y-m-d H:i:s') . '.jpg'; | |
file_put_contents($filename, $image); | |
/* | |
* | |
* Afterwards, compile video, e.g. |
This file contains hidden or 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
A conflict exist when you try to print screen inside a VirtualBox container, as the screenshot | |
will be captured by the VirtualBox host. Ideally, to avoid this you'll want to set the host's keyboard | |
shortcuts, the VirtualBox's host machine prefrences, and the VirtualBox keyboard shortcuts to a combination | |
that does not conflict and works for your workflow. | |
Personally, on the VirtualBox host, I am not interested in taking screenshots (as nearly exclusively inside | |
containers). Therefore, I will remove all screenshot shortcuts from the VirtualBox host. On CentOs 7 and | |
Ubuntu 18 this is under located Keyboard > Screenshot. | |
Next, under VirtualBox Preferences > Input > Virtual Machine I will set the Host Key Combination to a key |
This file contains hidden or 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
# initate a package | |
composer init | |
# push package to repository | |
git add . | |
git commit -m 'Init repo' | |
git push | |
# create a release in repository | |
https://github.com/hxtree/PXP/tree/v0.1.1-beta |
OlderNewer