VPSMATE

  • HOME
  • NEWS
  • VPS
  • DEDICATED
  • ARCHIVES
  • GoDaddy
  • SCRIPT
  • TOOLS
    • Traceroute
    • Benchmark
    • Useful Sites
  • Themes
  • GFW
Tips
Tips

One Liner to Fetch the Latest Github Release

Sometimes, it would be awfully convenient to grab the installer for the latest release of your favorite Github project directly from the command-line. And if it could incorporate awk, that would be great too.[1] Well, the following command-line is a pretty nifty template to do just that! You will need cURL, shipped with macOS, or Wget, shipped with Linux, for this to work. Substitute in the user or organization name, the project’s name, and the desired file extension for the <user>, <repo>, and <extension> fields respectively. Download the latest Github release (cURL) $ curl -s https://api.github.com/repos/<user>/<repo>/releases/latest \ | awk -F': ' '/browser_download_url/ && /\.<file extension>/ {gsub(/"/, "", $(NF)); system("curl -LO " $(NF))}' Download the latest Github release (Wget) $ wget -q -nv -O - https://api.github.com/repos/<user>/<repo>/releases/latest \ | awk -F': ' '/browser_download_url/ && /\.<file extension>/ \ {gsub(/"/, "", $(NF)); system("wget -qi -L " $(NF))}' Here is a quick explanation. First, cURL or Wget obtains the response from an HTTP GET request.[2] This response contains the URLs for the various artifacts for the latest release of the project. Next, awk processes the response, finding the line containing a download URL and matching the given file extension. It then removes the quotation marks surrounding the URL and downloads the file directly with cURL or Wget. It’s also easy enough to modify the match pattern for the file extension to make it more specific if need be. The following example demonstrates this by fetching the latest Linux release zip file of the Ninja build system. Download the latest Ninja release (cURL) $ curl -s https://api.github.com/repos/ninja-build/ninja/releases/latest \ | awk -F': ' '/browser_download_url/ && /linux\.zip/ {gsub(/"/, "", $(NF));…

16/09/2022 0comments 43hotness 0likes kyaky Read all
Tips

Add swap memory on AlmaLinux 8.5

What is swap space/memory?    When the amount of physical memory (RAM) is full, swap space in Linux is used. Non-active pages in memory are moved to the swap memory if the system requires more memory resources and also the RAM is complete. While swap memory can help devices with a percentage of RAM, it should not be thought about a substitute for more RAM. Swap memory is located on hard disk drives, which have a slower accessibility time than physical memory.   What is the formula to determine the required swap memory?   The swap space ought to amount to 2x physical RAM for approximately 2 GB of physical RAM, and after that an extra 1x physical RAM for any kind of amount over 2 GB, yet never ever less than 32 MB. For systems with actually big amounts of RAM (more than 32 GB), you can likely get away with a smaller swap partition (around 1/2 half the physical RAM).   So, if:   Using this formula:   A system with 2 GB of physical RAM would certainly have 4 GB of swap memory. A system with 3 GB of physical RAM would certainly have 3 GB of swap memory. A system with 64 GB of physical RAM would certainly have 32 GB of swap memory.   If you intend to upgrade your RAM at a later time, creating a huge swap space partition can be particularly practical.   Identifying current swap space   Before you start, check if your AlmaLinux installation already has swap enabled by typing: cat…

30/08/2022 0comments 71hotness 0likes kyaky Read all
Tips

How to setup fastestmirror in CentOS 8 Dnf

Dnf by default does not choose the fastest mirror, but this can be changed by editing the dnf.conf file. The dnf.conf file is in /etc/dnf/dnf.conf. Edit the file Once the file opens the content should look something like this. Let’s add fastmirror to the config and enable it.   Add below the line skip_if_unavaiable=True the following. The dnf.conf should look like this. Save the file. Run the following command.

23/11/2020 0comments 1973hotness 0likes kyaky Read all
Tips

rclone mount mega.nz cloud storage as local drive

 

06/09/2020 0comments 1828hotness 0likes kyaky Read all
Tips

Unix Create a Symbolic Link

How do I create a symbolic links under Linux or Unix like operating systems using command line options? You need to use the ln command. It is a standard Unix / Linux / BSD command to create links to files. There are two types of links under UNIX, hard and soft link: Hard link vs. Soft link in Linux or UNIX [a] Hard links cannot links directories ( cannot link /tmp with /home/you/tmp) [b] Hard links cannot cross file system boundaries ( cannot link /tmp mounted on/tmp to 2nd hard disk mounted on /harddisk2)  Symbolic links refer to a symbolic path indicating the abstract location of another file [d] Hard links, refer to the specific location of physical data. UNIX create a symbolic link command To create a symbolic link, enter: $ ln -s {/path/to/file-name} {link-name} $ ln -s /shared/sales/data/file.txt sales.data.txt $ vi sales.data.txt $ ls -l sales.data.txt How do I delete a symbolic link? To delete a link, enter: $ rm {link-name} $ rm sales.data.txt $ ls -l $ ls -l /shared/sales/data/file.txt If you delete the soft link itself (sales.data.txt) , the data file would still be there ( /shared/sales/data/file.txt ). However, if you delete /shared/sales/data/file.txt, sales.data.txt becomes a broken link and data is lost. UNIX create a hardlink command To create hard link, enter (without the -s option): $ ln {file.txt} {hard-link} $ ln /tmp/file link-here How do I delete a hard link? You can delete hard link with the rm command itself: $ rm {hard-link} $ rm link-here If you delete a hard link, your data would be there. If you delete /tmp/file your data still be accessible via link-here hard link file.

06/09/2020 0comments 883hotness 0likes kyaky Read all
Tips

How to secure Nginx against all malicious web crawlers / bots

Protective measures for a server are very important and there are several ways to protect your websites and apps from malicious bots. You can just simply add this piece of code into Nginx Conf file server{} section:

05/09/2020 0comments 786hotness 0likes kyaky Read all
Tips

Windows 10: Unknown System (Z:) Partition or Disk.

Some bit of indigestion during an update has left one of your system reserved partitions on the hard disk hanging out. I don't think anybody's come up with a set-in-stone solution yet : the problem appears to be random, sometimes disappearing after a few days. (you can Search these forums for other similar issues) But, seeing as it's been a few months, if you're feeling adventurous, you could run DiskPart and try and remove the letter. Open up a Command Prompt (Administrator) : <Win+X> then select from the Powerusers Menu... Start typing...     a list of all your lettered volumes should appear substituting the number corresponding to your z drive for 'n'     If that works, restart and see if the change is persistent. If horrible things start happening, reverse the process... list and select as before then

01/11/2017 0comments 2491hotness 0likes kyaky Read all
Tips

How to setup network after RHEL/CentOS 7 minimal installation

After installing RHEL/CentOS 7 minimal and sleeping with your u shaped body pillow, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default. This guide explain you to setup network on RHEL/CentOS 7. Setup network on CentOS 7 minimal First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine: “nmcli d” command output Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options). CentOS_7 Network manager screen Now choose you network interfaces and click “Edit” Edit your network interfaces DHCP configuration Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager. Set ip adress using DHCP Reset network services: service network restart Now your server will get IP Address from DHCP . CentOS 7 check ip address

21/08/2017 0comments 2770hotness 0likes kyaky Read all
QuickFix

Vesta nginx restart failed

Use "nginx -t" to debug nginx issues. It's a known issue when nginx fails to start in Vesta due to some misconfiguation occurred by itself. nginx: [emerg] the same path name "/var/cache/nginx/xxx.es" used in /etc/nginx/conf.d/01_caching_pool.conf:2 and in /etc/nginx/conf.d/01_caching_pool.conf:3 nginx: configuration file /etc/nginx/nginx.conf test failed nginx: [emerg] the same path name "/var/cache/nginx/xxx.es" used in /etc/nginx/conf.d/01_caching_pool.conf:2 and in /etc/nginx/conf.d/01_caching_pool.conf:3 nginx: configuration file /etc/nginx/nginx.conf test failed [[email protected] ~]# cat /etc/nginx/conf.d/01_caching_pool.conf proxy_cache_path /var/cache/nginx/xxx.com levels=2 keys_zone=xxx.com:10m inactive=60m max_size=512m; proxy_cache_path /var/cache/nginx/xxx.es levels=2 keys_zone=xxx.es:10m inactive=60m max_size=512m; remove all the duplicate lines. And then restart nginx.

17/03/2017 0comments 4261hotness 0likes kyaky Read all
Tips

Change Timezone in CentOS

  You just got your new CentOS dedicated server, and you notice that times in your logs aren’t quite right. You check the time from the command line (run date), and find that the timezone is set to US Eastern or some other timezone. How do you get this changed? Unfortunately, this is not an easy thing to figure out. Fortunately though, it’s not hard to do with the right directions. Please note that you have to have root access to be able to make the changes detailed below. There are a series of time zone files located at /usr/share/zoneinfo. Select the appropriate named timezone for your location. For my location, Oklahoma, USA, I actually have two that I can select from: America/Chicago or US/Central. Make note of the appropriate folder and file for your timezone. The active timezone used on your system is in the /etc/localtime file. The default will vary depending on your server host but often seems to be EST or EDT (depending on the time of year you are checking). We simply need to replace this file with the file we selected in the previous step. Now, I say replace, but I actually recommend creating a link to the pertinent file rather than actually making a copy. Let me explain the reasoning for this quickly. A crucial part of the timezone shift calculations is the daylight savings calculations. Many people don’t realize this, but the daylight savings days were changed in 2007. When this change happened, all servers needed to be updated with new zoneinfo files.…

17/03/2017 0comments 2845hotness 0likes kyaky Read all
Tips

List of VMware Default Usernames and Passwords

Here is a comprehensive list of default username and passwords for most of the VMware products. If you're like me, you tend to get alot of these confused. If I left any off, please let me know in the comments.   Horizon Application Manager http://IPorDNS/SAAS/login/0 http://IPorDNS   Horizon Connector https://IPorDNS:8443/   vCenter Appliance Configuration https://IPorDNS_of_Server:5480 username: root password: vmware   vCenter Application Discovery Manager http://IPorDNS username: root password: 123456 default ADM management console password is 123456 and the CLI password is ChangeMe   vCenter Chargeback http://IPorDNS:8080/cbmui/ username: root password: vmware   vCenter Infrastructure Navigator: https://IPorDNS_of_Server:5480 username: root password: Supplied during OVA deployment   vCenter Log Insight https:// log_insight-host/ username: admin password: password specified during initial configuration   vCenter MOB https://vcenterIP/mob   vCenter Web Client Configuration https://IPorDNS_of_Server:9443/admin-app username: root password: vmware   vCenter vSphere Web Client Access https://IPorDNS_of_Server:9443/vsphere-client/ username: root password: vmware For vSphere 5.1  = Windows default username: [email protected] For vSphere 5.1 = Linux (Virtual Appliance) default username: [email protected] For vSphere 5.5 = default username: [email protected]   vCenter Single Sign On (SSO) https://IPorDNS_of_Server:7444/lookupservice/sdk For vSphere 5.1 = Windows default username: [email protected] For vSphere 5.1 = Linux (Virtual Appliance) default username: [email protected] password: specified during installation Adding AD authentication to VMware SSO 5.1 For vSphere 5.5 = default username: [email protected]   vCenter Orchestrator Appliance http://orchestrator_appliance_ip Appliance Configuration: change the root password of the appliance Linux user. Otherwise, the first time when you try to log in to the appliance Web console, you will be prompted to change the password. Orchestrator Configuration: username: vmware password:vmware Orchestrator Client: username: vcoadmin password: vcoadmin Web…

23/09/2014 0comments 14907hotness 0likes kyaky Read all
Tips

CentOS – locate command

To find files on a linux system you can use following command: # find / -name xxxx But I prefer to use the locate command. This command is extremely easy to use and it’s faster than the find-command. # locate filename To install the locate package, use yum. # yum install mlocate To update it’s ‘internal database’, run following command. # updatedb To find a file, use following command # locate httpd.conf /etc/httpd/conf/httpd.conf

17/09/2014 0comments 13831hotness 0likes kyaky Read all
Tips

Webuzo - Nginx rewrite rule for Wordpress

People find unable to get permalink work in Wordpress when use Nginx stack. It's because Nginx rewrite rule for Wordpress has been set up. Follow the instruction below to get this done. At the beginning, I thought the following method was alright till I found out it was generated by Webuzo and gets overwritten by Webuzo every time you make site configuration change. nano /usr/local/apps/nginx/etc/conf.d/webuzoVH.conf Add: if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } make it look like: server { listen 80; server_name yoursite.com www.yoursite.com; # The Document Root root /home/admin/www/yoursite.com; error_log /usr/local/apps/nginx/var/log/yoursite.com.err; access_log /usr/local/apps/nginx/var/log/yoursite.com.log main; include /usr/local/apps/nginx/etc/conf.d/common; if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } } restart nginx service nginx restart So, let add the rewrite in /usr/local/apps/nginx/etc/conf.d/common add the following to the file: #For wordpress if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } Then, restart nginx service nginx restart    

16/09/2014 0comments 8458hotness 0likes kyaky Read all
Tips

Lighttpd rewrite rules for WordPress sites

Rewrite rules compatible with WordPress permalinks: # Handle 404 errors server.error-handler-404 = "/index.php" # Rewrite rules url.rewrite-final = ( # Exclude some directories from rewriting "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", # Exclude .php files at root from rewriting "^/(.*.php)" => "$0", # Handle permalinks and RSS feeds "^/(.*)$" => "/index.php/$1" )  

16/09/2014 1comments 5628hotness 0likes kyaky Read all
Tips

How-to enable root access on Ubuntu 14.04

Simply adding a password for root is not enough for Ubuntu 14.04 Server. You need to edit /etc/ssh/sshd_config, and commend out the following line: PermitRootLogin without-password Just below it, add the following line: PermitRootLogin yes Then restart SSH: service ssh restart  

01/09/2014 0comments 4630hotness 0likes kyaky Read all
Tips

Change Hostname in CentOS 6.5/7

CentOS 6.5 [1] Change hostname with a commnad (but if rebooting, it will be back). [[email protected] ~]# hostname # show current hostname srv1.vpsmate.net [[email protected] ~]# hostname srv2.vpsmate.net # change hostname [[email protected] ~]# hostname srv2.vpsmate.net [2] Change hostname permanently. [[email protected] ~]# vi /etc/sysconfig/network # change HOSTNAME=srv2.vpsmate.net [[email protected] ~]# exit CentOS release 6.5 Kernel xxx srv2.vpsmate.net login: # changed   CentOS 7 [1]Change hostname with a commnad (but if rebooting, it will be back). [[email protected] ~]# hostname # show current hostname srv1.vpsmate.net [[email protected] ~]# hostname srv2.vpsmate.net # change hostname [[email protected] ~]# hostname srv2.vpsmate.net [2] Change hostname permanently. [[email protected] ~]# vi /etc/hostname # change srv1.vpsmate.net [[email protected] ~]# exit CentOS Linux 7 Kernel 3.10.0-123.4.2.el7.x86_64 on an x86_64 srv1 login: # just changed      

10/07/2014 0comments 7606hotness 0likes kyaky Read all
Tips

[VMware]Unable to initialize a second virtual disk within Windows 2008 / Windows 2008 R2 / Windows 2012

Unable to initialize a second virtual disk within Windows 2008 or Windows 2008 R2 (2000767) Symptoms After adding virtual disk on Windows 2008 and Windows 2008 R2, you cannot make disk online Windows 2008 and Windows 2008 R2 virtual machine is configured with Virtual Hardware version 7 You see this error within Windows under Disk Management:The disk is offline because of policy set by an administrator Resolution To resolve this issue: Open a command prompt from within the virtual machine. To run the Diskpart utility, run the command:diskpart.exe  To display the SAN policy, run the command:diskpart> sanSAN Policy: Offline Shared Change the SAN policy to be online with the command:diskpart> san policy=OnlineAllDiskpart successfully changed the SAN policy for the current operating system. To get a summary information about each disk, run the command:diskpart>list diskDisk Status Size Free Dyn Gpt --------------- ------------------ ----------- ---------- Disk 0 Online 40 GB 0 B *Disk 1 Offline 60 GB 1024 KB Select Disk 1 (currently offline disk) with the command:diskpart>select disk 1Disk 1 is now the selected disk Note: From this point, all diskpart commands apply to this disk. Clear the read-only attribute for the Disk 1 with the command:diskpart>attributes disk clear readonlydisk attributes cleared successfully To check that the read-only attribute has been cleared, run the command: diskpart>attributes disk current read-only state: no boot disk: no pagefile disk: no hibernation file disk: no crashdump disk: no clustered disk: no Bring Disk 1 online with the command:diskpart>online diskdiskpart successfully onlined the selected disk The disk should now be able to be assigned a drive letter and be mounted.

04/07/2014 0comments 7924hotness 0likes kyaky Read all
Tips

[Fix]FireFox Error code: sec_error_ocsp_unknown_cert

OCSP (Online Certificate Status Protocol) is an Internet protocol used to determine the status of a website's certificate used for secure communications. This article describes how to fix or work around the error message, The OCSP server has no status for the certificate. For other security-related error messages, see Troubleshoot the "Secure Connection Failed" error message.

25/05/2014 0comments 8120hotness 0likes kyaky Read all
123
Archives
  • February 2023
  • September 2022
  • August 2022
  • July 2021
  • November 2020
  • September 2020
  • August 2020
  • November 2017
  • August 2017
  • July 2017
  • March 2017
  • October 2016
  • September 2016
  • June 2016
  • April 2016
  • March 2015
  • November 2014
  • October 2014
  • September 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
Highly Recommended!
Vultr
Links
Suggested Web Hosting
Suggested VPS
1.Unmetered G Port & Unlimited Backups 3.Fast Replies 4.Free credits 5.Torrent Friendly A Name You Can Trust
Digitalocean,$5/Mo-512m KVM+20GSSD

Budgetvm 1G Ram/3IP/80G/$48/yr

Photonvps/512mKVM/10GSSD/5.95$

Linode, Top Xen VPS Company

VPS.net, Top Cloud VPS Company

Domain Discounts
DMCA.com Protection Status

COPYRIGHT © 2021 vpsmate.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang