Skip to content

Instantly share code, notes, and snippets.

View mrgonext's full-sized avatar

Teen mrgonext

View GitHub Profile
@mrgonext
mrgonext / Squirrel.Windows.txt
Created September 4, 2019 07:40
Squirrel.Windows end
https://github.com/Squirrel/Squirrel.Windows/issues/1470
@mrgonext
mrgonext / jenkins note.txt
Created September 4, 2019 06:27
jenkins set next build number
def strnumber = BUILD_NUMBER // current build number of current job
def intValue = strnumber.toInteger()
Jenkins.instance.getItemByFullName("theOtherJobName").updateNextBuildNumber(intValue)
// def job = Jenkins.instance.getItemByFullName("theOtherJobName")
// job.nextBuildNumber = intValue
// job.save()
@mrgonext
mrgonext / sshport.txt
Last active January 8, 2019 03:24
Changing the default SSH port on CentOS 7
To change the default SSH port, the first thing you want to do is backup the current SSH configuration on your system. To do that, run the commands below.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
This creates a new named sshd_config.bak with the current settings of the sshd_config file. If something goes wrong, you can then restore the file from the backup.
Next, run the commands below to open the default SSH configuration file
sudo vi /etc/ssh/sshd_config
@mrgonext
mrgonext / Increase A VMware Disk Size.html
Last active September 26, 2018 04:04
Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting
Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting
Mattias Geniar, Friday, August 27, 2010 - last modified: Sunday, July 24, 2016
To increase the size of your VMware Virtual Machine, you need to do 2 major steps. First, you need to increase the disk's size in your vSphere Client or through the CLI. This will increase the "hardware" disk that your Virtual Machine can see. Then, you need to utilize that extra space by partitioning it. If you're interested in just resizing your Linux LVM, please proceed to step 2.
In this example, I'm increasing a 3GB disk to a 10GB disk (so you can follow using the examples).
I would advise you to read the excellent documention on Logical Volume Management on tldp.org.
Just a small note beforehand; if your server supports hot adding new disks, you can just as easily add a new Hard Disk to your Virtual Machine. You can increase the LVM volume without rebooting your Virtual Machine by rescanning the SCSI bus, more on that later in this article.
@mrgonext
mrgonext / MongoDB note.txt
Last active September 7, 2018 16:24
backup and restore MongoDB server
1. backup and restore server
mongodump --host "192.168.0.44:27123" --archive=prod.20180907.gz --gzip
mongorestore --host "192.168.0.44:27123" --archive=prod.20180907.gz --gzip
2. Replication
rs.initiate( {
_id : "rs1",
members: [
{ _id: 0, host: "192.168.0.252:27017" },
@mrgonext
mrgonext / Creating a new virtual disk.txt
Created September 7, 2018 01:30
Creating a new virtual disk for an existing Linux virtual machine
Note: The preceding link was correct as of May 19, 2015. If you find the link is broken, please provide feedback and a VMware employee will update the link.
To create a new virtual disk for an existing Linux virtual machine:
Log in as root on your Linux virtual machine.
Run this command and make note of the sdx entries
ls /dev/sd*
Log in to the vCenter Server using the vSphere Client.
In the vSphere Client inventory, right-click the virtual machine and select Edit Settings.
Click the Hardware tab and click Add.
@mrgonext
mrgonext / Extend Logical Volume Centos.txt
Created September 7, 2018 01:15
Extending a logical volume in a virtual machine running Red Hat or Cent OS
To extend the logical volume:
Note: These steps only apply to EXT3 file systems.
Caution: VMware recommends to take a complete backup of the virtual machine prior to making these changes.
Power off the virtual machine.
Edit the virtual machine settings and extend the virtual disk size. For more information, see Increasing the size of a virtual disk (1004047).
Power on the virtual machine.
Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:
# fdisk -l
@mrgonext
mrgonext / 1. Install Redis
Created August 23, 2017 03:32 — forked from pbolduc/1. Install Redis
Install redis on CentOS 7
# see How to Install Redis Server on CentOS 7 - http://linoxide.com/storage/install-redis-server-centos-7/
# --- Compiling ---
$ yum install gcc make tcl
$ REDIS_VER=3.2.3
$ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz
$ tar xzvf redis-$REDIS_VER.tar.gz
$ cd redis-$REDIS_VER
$ make
$ make test
@mrgonext
mrgonext / BackupGitlab.sh
Created December 1, 2015 06:52 — forked from yyfrankyy/BackupGitlab.sh
Backup Gitlab Day by day to Dropbox
#!/bin/sh
# You might want to put this script in crontab, backup day by day.
#
# $ sudo -u git -H crontab -l
# $ 0 0 1 * * /path/to/your/BackupGitlab.sh
cd /home/git/gitlab
/usr/local/bin/bundle exec rake gitlab:backup:create RAILS_ENV=production