Skip to content

Instantly share code, notes, and snippets.

@csandanov
csandanov / generate-solr-password.go
Last active May 3, 2024 16:55
Generate solr password (sha256+salt) in golang
// https://go.dev/play/p/luLFCOgkos9
package main
import (
"crypto/sha256"
"encoding/base64"
"fmt"
)
func main() {
@csandanov
csandanov / install.sh
Created May 24, 2019 07:01
Install GNU sed and grep on macOS
brew install gnu-sed
brew install grep
# Add to path your shell profile (e.g. ~/.zshrc).
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:$PATH
@csandanov
csandanov / jquery.js
Created March 21, 2019 08:12
jquery connect
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
@csandanov
csandanov / log.sh
Created November 1, 2018 03:25
macOS sleep/wake log
#!/bin/sh
pmset -g log|grep -e " Sleep " -e " Wake " -e " Display is turned on "
@csandanov
csandanov / example-images-archives.txt
Last active August 3, 2018 02:24
Image example archives
http://www.artensoft.com/ArtensoftPhotoCollageMaker/photobases.php?V1.4.83_SR=_r0_N_
@csandanov
csandanov / macos-spotlight-search-reindex
Created September 17, 2017 16:59
Reindex macos spotlight search
sudo mdutil -a -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -a -i on
@csandanov
csandanov / drupal-7-install-php-redirect.patch
Last active June 21, 2017 05:39
Check if Drupal 7 is installed when db credentials specified
--- includes/bootstrap.inc (revision f1c0124ff5118a1b66bff99fb45bd5c3ed5acbab)
+++ includes/bootstrap.inc (revision )
@@ -2745,6 +2745,11 @@
if (version_compare(PHP_VERSION, '5.4') >= 0) {
spl_autoload_register('drupal_autoload_trait');
}
+
+ if (!db_table_exists('semaphore')) {
+ include_once DRUPAL_ROOT . '/includes/install.inc';
+ install_goto('install.php');