Skip to content

Instantly share code, notes, and snippets.

View sintret's full-sized avatar

andy fitria sintret

View GitHub Profile
@sintret
sintret / gist:37690ddcb835cfd05ba30397c359590d
Created February 16, 2024 18:03
Find and delete duplicate data in mysql postgresql
==mysql
SELECT employee_id, date FROM attendance group by date,employee_id having count(*) >= 2
DELETE t1 FROM attendance t1
INNER JOIN attendance t2
WHERE
t1.id < t2.id AND
t1.employee_id = t2.employee_id AND
t1.date = t2.date
;
@sintret
sintret / sudoers
Created August 16, 2022 10:28
sudoers user linux
adduser andy
usermod -aG sudo andy
@sintret
sintret / DO
Last active August 5, 2022 07:30
wildcard SSL using Digital Ocean API
$ sudo apt install python3-certbot-dns-digitalocean
$ certbot plugins
$ nano ~/certbot-creds.ini
# DigitalOcean API credentials used by Certbot
dns_digitalocean_token = dop_v1_4b621067b53b50.... Your API TOken
$ chmod 600 ~/certbot-creds.ini
@sintret
sintret / mysql
Last active January 5, 2022 18:17
SHOW VARIABLES;
SELECT @@GLOBAL.sql_mode;
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'total' cannot be null
Create mysqlId in the following way:
sql_mode= ""
SET sql_mode = '';
run mysql in background
const puppeteer = require('puppeteer');
var pages = {}
var browser;
var page = async() => {
try {
if (!browser) {
browser = await puppeteer.launch({
args: [
'--no-sandbox',
var http = require('http');
const puppeteer = require("puppeteer");
var url = require('url');
const PORT = 3000;
let browser;
let pages = {} //store object if you want to store each page url
console.log(`Running at Port : ${PORT}`)
npm_config_user=root npm install -g ...
@sintret
sintret / postgresql
Last active January 14, 2023 17:43
CREATE TABLE zgrid (
id SERIAL PRIMARY KEY,
"user_id" integer,
routename VARCHAR(100),
visibles text,
invisibles text,
labels text,
filter text,
"updated_at" timestamp,
"modified_by" integer,
nano /etc/my.cnf
add skip-grant-table
[mysqld]
skip-grant-tables
port=3306
datadir=/var/lib/mysql
https://www.faqforge.com/linux/how-to-renew-the-ispconfig-3-ssl-certificate/
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install
php -q update.php
//START//
This is for ispconfig for debian 9