Skip to content

Instantly share code, notes, and snippets.

View groundcat's full-sized avatar

groundcat

  • Pennsylvania, US
  • 18:28 (UTC -04:00)
View GitHub Profile
@groundcat
groundcat / Full-Screen-iFrame
Last active February 22, 2019 21:37
Full Screen iFrame
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<style>
body{
margin:0;
padding:0;
overflow-y:hidden
@groundcat
groundcat / Import CSV to MySQL by PHP
Created April 27, 2019 16:09
Import CSV to MySQL by PHP
<?php
// Debug
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Connect
$conn = mysqli_connect("IP", "USERNAME", "PASSWORD", "DBNAME");
@groundcat
groundcat / Fix-Debian-8-apt-sources.list.md
Last active August 23, 2019 20:37
Fix Debian 8 sources.list and 404 issues

Edit sources.list

nano /etc/apt/sources.list

Replace it with:

deb http://ftp.debian.org/debian jessie main contrib
deb http://ftp.debian.org/debian jessie-updates main contrib
deb http://security.debian.org jessie/updates main contrib
@groundcat
groundcat / cloudflared-install.md
Last active October 21, 2019 03:39
DNS over HTTPS for MacOS

Install Cloudflared

Install via Terminal:

curl https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-darwin-amd64.tgz | tar xzC /usr/local/bin

Create and edit /usr/local/etc/cloudflared/config.yml

@groundcat
groundcat / keep-rclone-running.md
Last active May 16, 2020 02:31
Keep rclone running with cronjob

Install rclone:

curl https://rclone.org/install.sh | sudo bash

Configure rclone remote:

rclone config
@groundcat
groundcat / Allows Read and Write Access to S3 Bucket.md
Created July 18, 2020 21:21
IAM Users - Allows Read and Write Access to S3 Bucket
@groundcat
groundcat / Optimize_Oracle_Cloud_VPS.md
Created May 27, 2021 04:04
Optimize Oracle Cloud VPS

Ubuntu iptables

The Oracle Cloud Ubuntu images come with somewhat restrictive iptables rules by default. Docker manages the instance firewall and we have the Oracle Cloud firewall in front, so let's remove the current firewall to avoid trouble:

apt purge netfilter-persistent iptables-persistent

Remove useless stuff (optional)

@groundcat
groundcat / hardern-ssh.md
Last active March 10, 2022 05:32
Harden the SSHD login and configuration

Create the user, replacing example_user with your desired username. You’ll then be asked to assign the user a password:

adduser ubuntu

Add the user to the sudo group so you’ll have administrative privileges:

@groundcat
groundcat / swap.sh
Created April 12, 2022 19:29
Linux VPS一键添加/删除Swap虚拟内存
#!/usr/bin/env bash
#Blog:https://www.moerats.com/
Green="\033[32m"
Font="\033[0m"
Red="\033[31m"
#root权限
root_need(){
if [[ $EUID -ne 0 ]]; then
@groundcat
groundcat / block-country-ip.sh
Last active May 22, 2022 06:19
Linux VPS block country 一键屏蔽指定国家所有的IP访问
#! /bin/bash
#Block-IPs-from-countries
#Github:https://github.com/iiiiiii1/Block-IPs-from-countries
#Blog:https://www.moerats.com/
Green="\033[32m"
Font="\033[0m"
#root权限
root_need(){