Skip to content

Instantly share code, notes, and snippets.

@samhagin
samhagin / install_python_3_centos
Created August 20, 2019 07:46
Install Python 3 on CentOS 7
# brought to you by doitwithcode.com
# add Inline with Upstream Stable repository
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# run an update
sudo yum update
# install Python 3
sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
@samhagin
samhagin / install_ssl.txt
Created August 12, 2019 16:45
Apache virtualhost definition and other instructions for installing SSL using acme.sh
# mod_ssl
yum install mod_ssl
# virtualhost
<VirtualHost *:80>
ServerName www.codedemo.gq
ServerAlias codedemo.qg
DocumentRoot /var/www/codedemo.gq/html
ErrorLog /var/www/codedemo.gq/logs/error.log
@samhagin
samhagin / installcpanel.sh
Last active June 8, 2018 10:40
Install cPanel
# install Perl if not already installed
yum -y install perl
# set a hostname for your server
hostname server.codebeginner.net
# change directory to /home
cd /home
# download the cPanel script
pip install coinbase
@samhagin
samhagin / scroll_instagram.js
Created July 13, 2017 01:12 — forked from LoranKloeze/scroll_instagram.js
Automatic scroll of Instagram page, stop scrolling by hand...
/*
Tired of scrolling to one of the last photos on the page on Instagram? Let your
browser do the scrolling for you!
31-05-2017
(c) 2017 - Loran Kloeze - loran@ralon.nl
Usage
- Go to https://www.instagram.com/instagram_handle/ (change instagram_handle in i.e. taylorswift)
- Open up the console (F12) (Firefox users: type 'allow pasting' if you haven't done so yet)
- Select the contents of this complete file and copy/paste it to the console and hit enter
@samhagin
samhagin / mass_reset_wordpress_passwords
Last active January 5, 2017 06:42
Mass Reset WordPress Passwords
#!/bin/bash
# Get all users from the database
users=$(mysql -u <user> -p<password> <dbname> -Bse "select user_login from wp_users")
# put the users in an array
array=( $users )
# for loop to set a random password, get the users email address, reset the password and send an email with the new password
for user in "${array[@]}"