Skip to content

Instantly share code, notes, and snippets.

View meena-erian's full-sized avatar
🎯
Focusing

Menas Erian meena-erian

🎯
Focusing
View GitHub Profile
sudo apt install -y curl unzip locales jq ca-certificates
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
ARCH=$(uname -m) # x86_64 on Intel/AMD, aarch64 on ARM
curl -fsSL "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-${ARCH}-linux-musl.zip" -o q-musl.zip
unzip -o q-musl.zip
cd q
./install.sh
@meena-erian
meena-erian / ProxmoxNewVolume.md
Created May 26, 2022 12:42
How to create a new Ext4 partition and add it to proxmox to store any kind of resources on it
  1. Find the SCSI disk path under /dev ( sda, sdb, or sdc etc ..) (Lets assume it's sdb)
  2. Create a new partition that takes 100% of the available space parted -a opt /dev/sdb mkpart primary ext4 0% 100% Lets assume the newly created partition is sdb1
  3. Format the new partition. Lets say we will give it the label MyVolume mkfs.ext4 -L MyVolume /dev/sdb1
  4. Prepare a new mount point for the new partition mkdir -p /mnt/MyVolumeMount
  5. Add a new line to /etc/fstab to mount the new partition in the new mounting point LABEL=MyVolume /mnt/MyVolumeMount ext4 defaults 0 2
  6. Now that you have the new Ext4 partition mounted on the host linux OS, All you have to do is to add it in proxmox. You can either add it from the UI or from the terminal:
    • From the UI:
      • In the "Server View" on the left side, click on "Datacenter" >> "Storage" >> "Add" >> "Directory"
  • Assign an "ID" for the partition, And set the "Directory" as /mnt/MyVolumeMount, and under "Content" you
@meena-erian
meena-erian / serverExecute.js
Last active February 19, 2020 16:07
JavaScript function to handle client-server command-based communication
/*\
|*| How to use serverExecute:
|*| A JavaScript object is passed as a parameter to serverExecute in order to send a command to the server
|*| where that object is sent to the backend server with all it parameters as the request parameters.
|*| however, the following parameters are processed by serverExecute itself:
|*|
|*| "onreturn" : type = function: Default: function(r){alert(r);}
|*| A function that will be called once the server respond to the http request containing the command.
|*| The server response is passed to the specified function.
|*|
@meena-erian
meena-erian / Force SSL, remove www and rediret all to index.php in apache .htaccess
Last active September 4, 2020 14:32
Apache configuration to force clients to load resources over secure HTTPS only
RewriteEngine On
# Non-www for portacode.com & remove trailing slashes
RewriteCond %{HTTP_HOST} ^www\.portacode\.com$ [NC]
RewriteRule ^(.*)\/$ https://portacode.com/$1 [L,R=301]
# End Non-www for portacode.com
# Force SSL
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@meena-erian
meena-erian / fade.js
Last active January 16, 2017 02:32
Fade in and fade out javaScript functions
// fade.js
// Fade in and fade out javaScript functions
//
// Copyright (C) 2016 Meena Erian
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
@meena-erian
meena-erian / DEW.vbs
Created December 28, 2016 18:45
Drive Explorer for Windows
' DEW (Drive Explorer for Windows):
' An application that shows hidden files on any pen drive once
' attached to the computer and deletes any suspicious shortcuts
' to help protecting you from computer worms.
'
' Copyright (C) 2016 Meena Erian
'
' Project origin <https://github.com/meena-erian/DEW>.
'
' This program is free software: you can redistribute it and/or modify