Skip to content

Instantly share code, notes, and snippets.

View 85mine's full-sized avatar
🎧
Listening music

Đàm 85mine

🎧
Listening music
View GitHub Profile
@85mine
85mine / Remove_app_Realme.bat
Created January 24, 2022 07:24
Remove_app_Realme.bat
@echo off
@echo Go bo ung dung rom china cho Realme
@echo ======================================================
echo.
echo.
adb devices
adb shell pm uninstall -k --user 0 com.wuba
adb shell pm uninstall -k --user 0 com.coloros.backuprestore
@85mine
85mine / sql_server.sql
Created October 22, 2021 03:29
Change SQL Server Database Collation
//https://ppolyzos.com/2016/12/07/change-sql-server-database/
USE master;
GO
-- Set to single-user mode
ALTER DATABASE [valentine]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
-- change collation
@85mine
85mine / psmo_data.ps1
Created October 5, 2021 06:46
Generate sql server script dump using SMO
#https://www.red-gate.com/simple-talk/databases/sql-server/database-administration-sql-server/automated-script-generation-with-powershell-and-smo/
# set "Option Explicit" to catch subtle errors
set-psdebug -strict
$DirectoryToSaveTo='C:\tmp'; # local directory to save build-scripts to
$servername='localhost'; # server name and instance
$Database='valentine'; # the database to copy from (Adventureworks here)
$Filename='valentine.sql';
$TableList='dlf_msvjyok,dlf_msyjyok';
# a list of tables with possible schema or database qualifications
# Adventureworks used for this example
@85mine
85mine / psmo.ps1
Created October 5, 2021 06:45 — forked from badmotorfinger/psmo.ps1
Generates scripts for most SQL Server database objects using PowerShell (SMO objects)
################################################################################################################################
#
# Script Name : SmoDb
# Version : 1.0
# Author : Vince Panuccio
# Purpose :
# This script generates one SQL script per database object including Stored Procedures,Tables,Views,
# User Defined Functions and User Defined Table Types. Useful for versionining a databsae in a CVS.
#
# Usage :
@85mine
85mine / crontab_certbot
Created March 10, 2021 06:10
Crontab for certbot
0 0 1 * * cd ~/certbot/ && source venv3/bin/activate && certbot renew --post-hook "systemctl reload nginx"
#!/bin/bash
wget https://repo.prime-strategy.co.jp/rpm/noarch/kusanagi-8.4.2-2.noarch.rpm
rpm2cpio kusanagi-8.4.2-2.noarch.rpm | cpio -id
cp -rf /tmp/usr/lib/kusanagi/resource/DocumentRoot/wp-content/mu-plugins/* /mu-plugins/
[kusanagi]
name=KUSANAGI RPM packages
baseurl=https://repo.prime-strategy.co.jp/rpm/noarch/
@85mine
85mine / workshop.sql
Last active September 11, 2020 07:48
EXPLAIN SELECT `repo_ydn_reports`.`adgroupID`,
`repo_ydn_reports`.`adgroupName`,
IFNULL(SUM(repo_ydn_reports.impressions), 0) AS impressions,
IFNULL(SUM(repo_ydn_reports.clicks), 0) AS clicks,
IFNULL(SUM(repo_ydn_reports.cost), 0) AS cost,
IFNULL(ROUND(AVG(repo_ydn_reports.ctr), 2), 0) AS ctr,
IFNULL(ROUND(AVG(repo_ydn_reports.averageCpc), 2), 0) AS averageCpc,
IFNULL(ROUND(AVG(repo_ydn_reports.averagePosition), 2), 0) AS averagePosition,
IFNULL(SUM(`conv0`.`conversions`), 0) AS 'YDN YDN conversion 221230 CV',
IFNULL((SUM(`conv0`.`conversions`) / SUM(`conv0`.`clicks`)) * 100, 0) AS 'YDN YDN conversion 221230 CVR',
@85mine
85mine / AppServiceProvider.php
Created May 14, 2020 09:28
laravel manual failed job insert
Queue::failing(function (JobFailed $event) {
// if ($event->job->resolveName() == 'App\Events\PrivateSendMessageEvent') {
// return;
// }
$table = 'failed_jobs';
$connection = $event->connectionName;
$queue = $event->job->getQueue();
$payload = $event->job->getRawBody();
$exception = $event->exception;
//dd($exception);
@85mine
85mine / gist:bbb62d6533f6d4f22aa619c1014a1aef
Last active April 17, 2020 09:31
plink.exe Demo bastion connect
MAP SSH MYSQL for HeidiSQL
plink.exe -i C:\Users\A\.ssh\key.ppk -ssh [email protected] -proxycmd "plink.exe -P 54824 -i C:\Users\A\.ssh\key.ppk -ssh [email protected] -nc 10.2.2.2:22" -N -L 127.0.0.1:3306:127.0.0.1:3306 -noagent
@85mine
85mine / code.php
Last active December 17, 2019 07:15
PHP Pet Code
<?php
// Random file name
$fileName = base64_encode(time()) . '_' . uniqid(md5(time()), true);
echo $fileName;