Skip to content

Instantly share code, notes, and snippets.

View htkcodes's full-sized avatar
🎯
Focusing

BL/VCK htkcodes

🎯
Focusing
View GitHub Profile
@htkcodes
htkcodes / kek.sh
Last active April 18, 2022 01:50
GETH reuse
cat /etc/systemd/system/geth.service
systemctl daemon-reload
systemctl status geth
systemctl restart geth
tail -n0 -f /opt/bsc/node/bsc.log
@htkcodes
htkcodes / useful.sh
Last active August 7, 2021 16:32
Useful scripts
#Grabs IP's from a file
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' file.txt
#COMMA SEP IP
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' ssl.txt | tr '\n' ',' | sed 's/.$//' - comma seperated ips
<?php
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'Hoang123');
define('DB_NAME', 'session_example');
define('DB_SERVER', 'localhost');
/* Attempt to connect to MySQL database */
/** @var mysqli $mysqli */
$mysqli = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
@jaytaylor
jaytaylor / react-unexpected-use-of-location.md
Created July 12, 2017 22:44
Solution for "Unexpected use of 'location'" React error.
React: Unexpected use of 'location';

Solution: Use window.location instead of bare location.

@LeeHyungGeun
LeeHyungGeun / nodejs with socketio_app.js
Last active April 20, 2022 19:25
Server-Side: nodejs with socket.io Client-Side: express3-handlebars DB: mongodb
var http = require('http');
var express = require('express');
var app = express();
var exphbs = require('express3-handlebars');
var path = require('path');
var server = http.createServer(app);
var io = require('socket.io').listen(server);
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:30000/people');