Skip to content

Instantly share code, notes, and snippets.

View rverrips's full-sized avatar

Roy Verrips rverrips

View GitHub Profile
@rverrips
rverrips / index.php
Created April 5, 2013 05:34 — forked from AleksJev/index.php
Guessing Game
<? session_start(); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Adapt</title>
<style type="text/css">
.num{
font-size: 244px;
height: 270px;
@rverrips
rverrips / EXAMPLE - Querying Incident table from client-side script.js ServiceNow EfficientGlideRecord: A MUCH more efficient and performant client-side GlideRecord queries, as efficient as GlideAjax (or more!)
//Client-side
doThing();
function doThing() {
let eGR = new EfficientGlideRecord('incident')
.setLimit(10)
.addNotNullQuery('assignment_group')
.addField('number')
.addField('short_description')
.addField('assignment_group', true) //Get display value as well
@rverrips
rverrips / README.md
Last active November 8, 2018 00:17 — forked from denvazh/README.md
Scheduled update for homebrew

Scheduled updates for homebrew

This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.

It will run in the following way:

  • brew update every day at 12:10
  • brew upgrade every day at 12:20

How to installload

@rverrips
rverrips / Howto convert a PFX to a seperate .key & .crt file
Created November 7, 2017 23:34 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`

Keybase proof

I hereby claim:

  • I am rverrips on github.
  • I am rverrips (https://keybase.io/rverrips) on keybase.
  • I have a public key ASAC4DGUn4G8mafCQw05vWpLd6W7et-01rq2UDvTrjQK9Ao

To claim this, I am signing this object:

@rverrips
rverrips / Howto-Migrate-MySQL.md
Created December 4, 2016 13:23
How To Migrate a MySQL Database Between Two Servers

How To Migrate a MySQL Database Between Two Servers Transferring a database between virtual private servers can be accomplished using a SCP (Secure Copy), a method of copying files derived from the SSH Shell. Keep in mind, you will need to know the passwords for both virtual servers.

In order to migrate the database, there are two steps:

Step One—Perform a MySQL Dump Before transferring the database file to the new VPS, we first need to back it up on the original virtual server by using the mysqldump command.

mysqldump -u root -p --opt [database name] > [database name].sql After the dump is performed, you are ready to transfer the database.

@rverrips
rverrips / webmin-install.sh
Created May 19, 2016 20:38
Recipe to Install Current Webmin on Debian/Ubuntu
#Install Perl Dependancies
apt-get install -f -y perl libnet-ssleay-perl openssl libauthen-pam-perl \
libpam-runtime libio-pty-perl libdbd-pg-perl apt-show-versions python
#Download Most Current Version Webmin
wget -c http://www.webmin.com/download/deb/webmin-current.deb
#Install Webmin
dpkg --install webmin-current.deb
@rverrips
rverrips / VLAN-Details
Created July 7, 2014 16:33
HP IMC Database query for VLANs
/** Pulls data from various tables in HP IMC 7.0 Database to:
Show all details for a specific VLAN across a campus.
Useful for sizing a migration of that VLAN to another VLAN, etc.
Change the VLan PVID on the "Where" section .. the example listes uas pv=6.
**/
SELECT [report_db].[report].[plat_v_dev].[symbol_name] AS Name,
[report_db].[report].[plat_v_dev].[dev_ip] AS IP,
[report_db].[report].[plat_v_dev].[dev_series_name] AS Series,
[report_db].[report].[plat_v_phy_if_info].[ifoptstatus] AS Status,
@rverrips
rverrips / gist:7412492
Created November 11, 2013 12:29
HP Script to enable ssh and disable telnet
### put the switch ip address in lines 3 and 17 ###
### put the username in to lines 4 and 18 and the password into lines 5 and 19 ###
telnet 10.1.0.11
admin
### put your password here ###
configure terminal
crypto key generate ssh rsa
ip ssh
ip ssh filetransfer
aaa authentication ssh login local none
/** In Microsoft SQL with unixtime ... do **/
Select DATEADD(second, @Unixtime-Variable, {d '1970-01-01'})