Skip to content

Instantly share code, notes, and snippets.

View AymanFekri's full-sized avatar

Ayman Negmeldin AymanFekri

View GitHub Profile
@AymanFekri
AymanFekri / prekillacct.sh
Created April 5, 2024 16:00
create backup Prior to removing an account
#!/bin/bash
#/scripts/pkgacct "${@: -1}" /backup/
# Script Name: /usr/local/cpanel/scripts/prekillacct
# Purpose: Creates a backup of a cPanel user account before removing.
# License: MIT (refer to https://opensource.org/licenses/MIT for details)
argc=$#
argv=($@)
for (( j=0; j<argc; j++ )); do
@AymanFekri
AymanFekri / main.dart
Created October 3, 2023 08:58
amber-aurora-3258
import 'dart:convert';
void main() {
// Create Dart variables to store the name and mac_address values.
var name = "PC1";
var macAddress = "1ssdsjdjsdjsdjs";
// Create a map inside a map using a map literal.
var outerMap = {
"key1": "value1",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
@AymanFekri
AymanFekri / .gitignore
Created February 15, 2021 00:09 — forked from pingrishabh/.gitignore
Standardised gitignore for your Flutter apps & Dart projects
### Flutter Generated
.flutter-plugins-dependencies
# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
When trying to run ansbile from jenkins docker container (node : osx), ssh fails with this error:
"msg": "Failed to connect to the host via ssh: bind: File name too long\r\nunix_listener: cannot bind to path: /**jenkins home dir*/.ansible/cp/remote_host-remote_user.7QrNSMyakiT2YWdu",
----------------
.ssh/config
Host *
ControlPath /tmp/%r@%h:%p
-----------------
.ansible.cfg
@AymanFekri
AymanFekri / prekillacct-prekillacct.sh
Created July 29, 2019 18:56
Backup Sites Before Terminating on Cpanel Server
#!/bin/bash
# Backup Sites Before Terminating on Cpanel Server
# /usr/local/cpanel/scripts/prekillacct
argc=$#
argv=($@)
cpuser=""
for (( j=0; j<argc; j++ )); do
if [ ${argv[j]} == "user" ];then
cpuser="${argv[j+1]}"
fi
server {
listen 80;
root /home/rails/folder/public;
server_name sub.domain.ltd;
index index.htm index.html;
location ~ /.well-known {
allow all;
}
location / {
server {
listen 80;
root /home/rails/example/public;
server_name _;
index index.htm index.html;
location ~ /.well-known {
allow all;
}
==> /usr/local/apache/conf/includes/pre_virtualhost_global.conf <==
SSLHonorCipherOrder on
SSLCompression off
# vim /usr/local/apache/conf/userdata/ssl/2_4/{user name}/{domain name }/proxy.conf
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass / https://0.0.0.0:8443/
ProxyPassReverse / https://0.0.0.0:8443/
ProxyPreserveHost On # pass hostname
ProxyVia on