Skip to content

Instantly share code, notes, and snippets.

View chiendv's full-sized avatar

Jamie Duong chiendv

  • Việt Nam
View GitHub Profile
@chiendv
chiendv / naviat_data_modeler_reset_trial.sh
Created July 26, 2023 07:07
Reset Navicat Data Modeler Trial
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Data\ Modeler.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@chiendv
chiendv / Envoy.blade.php
Created March 16, 2022 12:50 — forked from gvsrepins/Envoy.blade.php
A Laravel envoy script for deployment
@servers(['production' => 'productionserver', 'local'=> 'vagrant@127.0.0.1 -p 2222'])
{{-- Configuration section --}}
@setup
/*
|--------------------------------------------------------------------------
| Git Config
|--------------------------------------------------------------------------
|
select device_token, count("id") as counter from deviceinfo GROUP BY device_token ORDER BY counter desc
SET @DATABASE_NAME = 'name_of_your_db';
SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=InnoDB;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = @DATABASE_NAME
AND `ENGINE` = 'MyISAM'
AND `TABLE_TYPE` = 'BASE TABLE'
ORDER BY table_name DESC;
@chiendv
chiendv / errorlog.php
Created December 1, 2015 02:01 — forked from efreed/errorlog.php
Apache error log UI
// No configuration needed, will automatically find the Apache log folder and read error.log
// Initialy displays the last 2k of contents and auto updates (and auto scrolls) as new lines show up
// Can enter a search phrase in the UI to ignore any new lines that do (or don't) contain the phrase
$tail = new PHPTail(GetApacheLogPath());
if(isset($_GET['ajax'])) { //We're getting an AJAX call
echo $tail->getNewLines($_GET['lastsize'], $_GET['grep'], $_GET['invert']);
exit();
}
// Regular GET/POST call, print out the GUI
@chiendv
chiendv / apache_error_log_parser.sh
Created December 1, 2015 01:58 — forked from marcanuy/apache_error_log_parser.sh
Apache error log list ordered by most common errors
#!/bin/bash
sed 's^\[.*\]^^g' error.log | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -n