Skip to content

Instantly share code, notes, and snippets.

View gildas-ld's full-sized avatar

Gildas Le Drogoff gildas-ld

View GitHub Profile
$sql = 'INSERT INTO users.contacts (firstname, created_at) VALUES (?, ?)';
$query = $db->prepare($sql);
$faker = Faker\Factory::create('fr_FR');
$insertedPKs = array();
for ($i = 0; $i < 100; $i++) {
$query->bindValue(1, $faker->firstName, PDO::PARAM_STR);
// $stmt->bindValue(2, $faker->lastName, PDO::PARAM_STR);
$query->bindValue(2, $faker->date("Y-m-d H:i:s"), PDO::PARAM_STR);
// $stmt->bindValue(1, $faker->email, PDO::PARAM_STR);
$query->execute();

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@gildas-ld
gildas-ld / mongodb_cheat_sheet.md
Created September 7, 2022 13:33 — forked from bradtraversy/mongodb_cheat_sheet.md
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@gildas-ld
gildas-ld / cheatsheet-elasticsearch.md
Created January 29, 2023 01:33 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
CREATE USER `user`@`%` IDENTIFIED VIA mysql_native_password USING '*6048229B303DAF9E889FCB02B385C27823607B85' OR unix_socket;
SHOW CREATE USER `user`@`%`\G
GRANT ALL PRIVILEGES ON *.* TO `user`@`%`;
FLUSH PRIVILEGES;
SET GLOBAL general_log = 'ON';
SET GLOBAL log_output='TABLE';
SET GLOBAL slow_query_log=1;
SET GLOBAL log_output='TABLE';
SET GLOBAL long_query_time=5.0;
@gildas-ld
gildas-ld / _golden-ratio.scss
Created August 28, 2023 14:31 — forked from gregrickaby/_golden-ratio.scss
Golden Ratio Typography for Sass
//
// Golden Ratio Typography
// --------------------------------------------------
// Golden Ratio Math
//
// Let's do some math so we can build beautiful typography and vertical rhythm.
// For any magic to happen, set the $ContentWidth variable on _variables.scss
// to match your content box width (normally this is 640px, 740px, etc...).
@gildas-ld
gildas-ld / chromiumUpdater.js
Created December 26, 2023 22:37 — forked from TayIorRobinson/chromiumUpdater.js
macOS Chromium Marmaduke build updater
// To use this simply install NodeJS (https://nodejs.org/)
// Then run node chromiumUpdater.js.
// You might want to put it in your crontab.
// Set to true for ASi builds
// Set to false for Intel builds
const APPLE_SILLICON = false
// Ignore No-Sync builds?
const SYNC_ONLY = true
// Show notifications

General OpenSSL Commands

These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.

Generate a new private key and Certificate Signing Request

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
@gildas-ld
gildas-ld / ntp.conf
Created January 18, 2024 16:39
ntp.conf
# Please consider joining the pool:
#
# http://www.pool.ntp.org/join.html
#
# For additional information see:
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - the ntp.conf man page
# NTP Servers