scp file_name.zip username@server_ip/server_address:/directory_path
Tuesday, November 26, 2024
Sunday, October 20, 2024
Office 2021 Activation using command
@echo off
title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================================================================&echo #Project: Activating Microsoft software products for FREE without additional software&echo =====================================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2021&echo - Microsoft Office Professional Plus 2021&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo =====================================================================================&echo Activating your product...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo ospp.vbs /setprt:1688 >nul&cscript //nologo ospp.vbs /unpkey:6F7TH >nul&set i=1&cscript //nologo ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH >nul||goto notsupported
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=kms7.office.com
if %i% EQU 2 set KMS=e8.us.to
if %i% EQU 3 set KMS=e9.us.to
if %i% GTR 3 goto ato
cscript //nologo ospp.vbs /sethst:%KMS% >nul
:ato
echo =====================================================================================&echo.&echo.&cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo =====================================================================================&echo.&echo #Please consider supporting this project: donate to my paypal "devomman@gmail" &echo #Your support is helping me keep my servers running 24/7!&echo.&echo =====================================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
explorer "https://www.office.com/"&goto halt
:notsupported
echo =====================================================================================&echo.&echo Sorry, your version is not supported.&echo.&goto halt
:busy
echo =====================================================================================&echo.&echo Sorry, the server is busy and can't respond to your request. Please try again.&echo.
:halt
pause >nul
Friday, October 11, 2024
Create an admin account in WordPress via MySQL
INSERT INTO `wp_users`(
`user_login`,
`user_pass`,
`user_nicename`,
`user_email`,
`user_status`
)
VALUES(
'admin999',
MD5('password999'),
'firstname lastname',
'email@example.com',
'0'
);
INSERT INTO `wp_usermeta`(
`umeta_id`,
`user_id`,
`meta_key`,
`meta_value`
)
VALUES(
NULL,
(
SELECT
MAX(id)
FROM
wp_users
),
'wp_capabilities',
'a:1:{s:13:"administrator";s:1:"1";}'
);
INSERT INTO `wp_usermeta`(
`umeta_id`,
`user_id`,
`meta_key`,
`meta_value`
)
VALUES(
NULL,
(
SELECT
MAX(id)
FROM
wp_users
),
'wp_user_level',
'10'
);
Wednesday, October 2, 2024
Contatenate text to Date to Sort
Convert 01.01.2024 to 01/01/2024 to count as date in Excel.
=DATE(RIGHT(A2,4),MID(A2,FIND(".",A2,1)+1,FIND(".",A2,FIND(".",A2,1)+1)-FIND(".",A2,1)-1),MID(A2,1,FIND(".",A2,1)))
Monday, September 30, 2024
How to install Plesk on Ubuntu 22.00 using a single command
# sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)
Monday, September 16, 2024
Toshiba e studio 2829a print using lan cable without router
To set up a Toshiba e-STUDIO 2829A printer to print using a LAN cable without a router, you'll need to directly connect the printer to your computer with an Ethernet cable and configure both devices to communicate with each other. Here's how you can do it:
Connect the Printer to the Computer:
- Plug one end of the Ethernet cable into the LAN port of the Toshiba e-STUDIO 2829A.
- Plug the other end of the Ethernet cable into the Ethernet port of your computer.
Set Static IP Addresses:
- Since there is no router to assign IP addresses dynamically, you need to set static IP addresses for both the printer and the computer.
Configure the Printer’s IP Address:
- Access the printer’s control panel.
- Navigate to the network settings (this can usually be found under Admin or System settings).
- Set a static IP address for the printer. For example, you might use
192.168.0.10
. - Ensure the subnet mask is set to
255.255.255.0
. - Save the settings.
Configure the Computer’s IP Address:
- On your computer, go to the network settings.
- Windows:
- Open Control Panel.
- Go to Network and Sharing Center.
- Click on Change adapter settings.
- Right-click on the Ethernet adapter connected to the printer and select Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Choose "Use the following IP address" and set the IP address to
192.168.0.20
(it should be different from the printer’s IP). - Set the subnet mask to
255.255.255.0
. - Leave the Default Gateway and DNS fields blank.
- Click OK to save the settings.
- Mac:
- Open System Preferences.
- Go to Network.
- Select Ethernet and click on Advanced.
- Go to the TCP/IP tab.
- Set Configure IPv4 to Manually.
- Enter
192.168.0.20
for the IP address and255.255.255.0
for the subnet mask. - Leave the Router field blank.
- Click OK and Apply to save the settings.
- Windows:
- On your computer, go to the network settings.
Add the Printer on the Computer:
- Now, you need to add the printer on your computer.
- Windows:
- Go to Control Panel.
- Select Devices and Printers.
- Click on Add a printer.
- Choose "Add a local printer or network printer with manual settings".
- Select "Create a new port" and choose Standard TCP/IP Port.
- Enter the printer’s IP address (
192.168.0.10
). - Follow the prompts to install the printer driver (you may need the printer driver software from Toshiba's website).
- Mac:
- Open System Preferences.
- Go to Printers & Scanners.
- Click the plus (+) button to add a printer.
- Select the IP tab.
- Enter the printer’s IP address (
192.168.0.10
). - Choose the appropriate protocol (typically HP Jetdirect - Socket).
- Enter a name for the printer and select the appropriate driver.
- Click Add.
- Windows:
- Now, you need to add the printer on your computer.
After completing these steps, your Toshiba e-STUDIO 2829A printer should be set up to print using a LAN cable directly connected to your computer without a router
Thursday, August 1, 2024
PHP releases
https://www.apachelounge.com/viewtopic.php?t=6359
https://windows.php.net/downloads/releases/
Tuesday, July 16, 2024
How to install SSL on CWP hostname?
1 - Check that you should have an A record for the hostname. For example if your server hostname is cp.hostinpk.com, then you should have an A record for "cp" pointing to server IP
2 - Login to CWP Admin Panel>> Server Settings>>Change Hostname and then hit "Change Hostname" button after putting your desired hostname (in my case cp.hostinpk.com). This will only generate a valid LE SSL for your hostname when an A record is present against hostname
3 - Perform following command from shell
Saturday, June 15, 2024
How to merge a branch to main branch in Github.
In Terminal or Command Prompt:
git checkout main [switch to main branch]
git pull origin main [grab latest updates from main branch]
git merge master merge [master branch to your main branch]
git push origin main [push your changes to main]
Wednesday, May 1, 2024
Extract Domain from email in Excel or Google sheet
=TEXTAFTER(A2, "@")
or,
=MID(A1, FIND("@", A1) + 1, LEN(A1) - FIND("@", A1))
Tuesday, April 30, 2024
Sunday, April 21, 2024
Exim configuration & Filter
There are two things that need to be configured. The system filter and the specific transport. If you only want to forward emails and not save them to the filesystem, the transport section is not needed.
Edit your exim configuration and add these lines at the top:
# /etc/exim.conf top
system_filter = /etc/system_filter.exim
system_filter_directory_transport = local_copy_outgoing
Add these lines lower in the configuration, in your transports section:
# /etc/exim.conf transpors section
local_copy_outgoing:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
group = mail
user = mail
mode = 0660
maildir_format = true
create_directory = true
Change the mail user to the specific user account on your system exim runs at. It could be named exim. You can check that with the getent passwd command.
To configure the actual saving and filtering create or edit the /etc/system_filter.exim file. The below snippets should be placed in that file, according to what you're trying to acomplish.
To save all outgoing mail from a specific domain to a maildir folder in /var/mail/:
if $sender_address_domain is example.tld
then
unseen save /var/mail/example.tld/mailarchive/.${tr{$sender_address}{.}{_}}.outgoing/
endif
Forward all outgoing from specific domain to specific email address:
if $sender_address_domain is example.tld
then
unseen deliver othermailbox@otherdomain.com
endif
Forward ALL outgoing mail to email address:
unseen deliver othermailbox@otherdomain.com
Save ALL outgoing email to maildir folder:
unseen save /var/mail/${tr{$sender_address_domain}{.}{_}}/mailarchive/${tr{$sender_address}{.}{_}}.outgoing/
The files are saved in a maildir structure:
ls -la /var/mail/example.tld/mailarchive/example\@example.tld.outgoing/new/
total 16
-rw-rw---- 1 mail mail 1632 Dec 15 20:31 1450207897.H829447P10443.example.tld
drwx------ 5 mail mail 4096 Dec 15 20:31 ..
-rw-rw---- 1 mail mail 1747 Dec 15 20:33 1450207983.H51962P10484.example.tld
drwx------ 2 mail mail 4096 Dec 15 20:33 .
Ref: Exim Documentation
Wednesday, April 17, 2024
Fix CWP – Apache error “Error retrieving pid file logs/httpd.pid
mv /usr/local/apache/logs/httpd.pid /usr/local/apache/logs/httpd.pid.bak
restart Apache
Sunday, April 7, 2024
How to forward all outbound mail sent from an email account on your centOS server
Filters and forwarders
that can be managed directly within a cPanel account are only applied to
incoming messages. They do not affect outbound messages. To forward outbound
messages, you need to create a system filter. This article provides an example
of how you can use an Exim system filter in cPanel to forward all outbound mail
from an email account.
Please note that cPanel
is not able to provide support for customizing the specific contents of your
Exim filters. If you need help crafting a custom filter, you should reach out
to a systems administrator with the skills, training, and expertise required to
do so for you.
Procedure
1.
Access the server's
command line as the 'root' user via SSH or "Terminal" in WHM.
2.
Create the filter file.
touch
/usr/local/cpanel/etc/exim/sysfilter/options/fowardOutbound.conf
3.
Open the newly created
filter file in your preferred text editor.
4.
Add the following to the
file.
if ("$h_from:" contains
"from@domain.tld")
then
## The following will make it so that
the original recipient is skipped and
## and only recipient@domain.tld will
recieve the message
deliver
"recipient@domain.tld"
## If you add the word unseen in
front, the message will be forwarded to
## recipient@domain.tld as well as
delivered to the original recipient.
## For example, you would remove the
above deliver line and replace it with:
## unseen deliver
"recipient@domain.tld"
endif
For multiple :
if $h_from: contains "user1@domain.com"
or $h_from: contains "user2@domain.com""
or $h_from: contains "user3@domain.com""
then
unseen deliver "user@domain.com"
endif
Please
note that 'from@domain.tld' and 'recipient@domain.tld' must be replaced with
the sender and recipient email addresses, respectively.
5.
Rebuild the Exim
configuration.
/scripts/buildeximconf
Please
note that cPanel will copy your custom filter into the system filter
file, /etc/cpanel_exim_system_filter.
6.
Restart Exim.
/scripts/restartsrv_exim
Thursday, April 4, 2024
Wednesday, April 3, 2024
Download Large File from Google Drive using API
Here are step-by-step instructions to download a file from Google Drive using the command line API if the file is shared privately and needs authentication.
Get the file ID:
- Go to your Google Drive in your browser.
- Right-click (or control-click) the file you want to download and click “Get shareable link”. The link looks like this:
https://drive.google.com/open?id=XXXXX
. Make note of the file ID “XXXXX”; you will be needing it below.
Get an OAuth token:
- Go to OAuth 2.0 Playground
- In the “Select the Scope” box, scroll down, expand “Drive API v3”, and select
https://www.googleapis.com/auth/drive.readonly
- Click “Authorize APIs” and then “Exchange authorization code for tokens”. Copy the “Access token”; you will be needing it below.
Download the file from the command line:
If using OS X or Linux, open the “Terminal” program and enter the following command.
- curl -H "Authorization: Bearer YYYYY" https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -o ZZZZZ
If using Windows, open the “PowerShell” program and enter the following command.
- Invoke-RestMethod -Uri https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -Method Get -Headers @{"Authorization"="Bearer YYYYY"} -OutFile ZZZZZ
In your command, replace “XXXXX” with the file ID from above, “YYYYY” with the access token from above, and “ZZZZZ” with the file name that will be saved (for example, “myFile.mp4” if you’re downloading an mp4 file).
Press Enter and let the download begin.
Tuesday, April 2, 2024
Wednesday, March 13, 2024
WordPress website Migration & Restore using All-In-One-WP-Migration
Copy cPanel to cPanel internal server Migration
cp /home/Source-cPanel-username/public_html/wp-content/ai1wm-backups/your-backup-file-name.wpress /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
Copy cPanel to cPanel Different server Migration
1. cd /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
2. wget use-source-url-https-link
Sunday, March 10, 2024
Rebuild BCD in Windows using CMD
- Boot your computer into Advanced Recovery Mode
- Launch Command Prompt available under Advanced Options.
- To rebuild the BCD or Boot Configuration Data file use the command – bootrec /rebuildbcd
- It will scan for other operating systems and let you select the OS’s you want to add to BCD
bcdboot c:\windows /s c:
Friday, February 16, 2024
Increment the cell in Vlookup when dragging horizontally in Excel
Monday, January 22, 2024
How to Install and Use PHP Composer on CentOS 7
sudo yum install php-cli php-zip wget unzip
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer
Upload file to server using Power Shell Command
scp file_name.zip username@server_ip/server_address:/directory_path
-
Put the following code in a TXT file and save as "file.cmd" then run the cmd file as administrator. @echo off title Activate Micr...
-
We can install PowerMTA on the server. rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm You will see the output like this Preparing... #############...
-
# $Id: config 2015-03-24 16:00:00 Jack $ # Sample PowerMTA configuration file # PowerMTA Multiple Virtual PMTA config file sample # # E-mai...