#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#!/bin/bash
#同步网络时间
echo “同步网络时间中…”
apt-get install -y ntpdate
ntpdate -u cn.pool.ntp.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -------------------------------------------------------------------- | |
# [init] Create run dir, env file if they don't exist, then source env | |
# -------------------------------------------------------------------- | |
init() { | |
MINIO_CONTAINER_NAME=$1 | |
MINIO_RUN_DIR=/data1/run/${MINIO_CONTAINER_NAME} | |
MINIO_DATA=${MINIO_RUN_DIR}/data | |
MINIO_CERTS=${MINIO_RUN_DIR}/certs | |
# create run dir for container instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SnowflakeIdGenerator | |
{ | |
public const byte DefaultMachineIdBits = 6; | |
public const byte DefaultSequenceBits = 12; | |
private readonly long _machineId = 0; | |
private readonly byte _machineIdBits = 0; | |
private readonly byte _sequenceBits = 0; | |
private readonly long _maxSequence = 0; | |
private readonly Stopwatch _stopwatch = Stopwatch.StartNew(); | |
private readonly object _lockObject = new object(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package logging | |
import ( | |
"time" | |
"github.com/sirupsen/logrus" | |
"github.com/snowzach/rotatefilehook" | |
"github.com/mattn/go-colorable" | |
) | |
[.NET: Int32] = [Oracle:NUMBER(2)..NUMBER(9)*]
[.NET: Int64] = [Oracle:NUMBER(10)..NUMBER(18)*]
[.NET: Double] = [Oracle:NUMBER(x, 0)..NUMBER(x, 15)*]
[.NET: Double] = [Oracle: FLOAT]
[.NET: Decimal] = [Oracle:NUMBER]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ref: https://stackoverflow.com/questions/11595217/convert-bigint-unsigned-to-int#11595484 | |
*/ | |
/* | |
CREATE FUNCTION long2int (n BIGINT) RETURNS INT(11) RETURN n; | |
*/ | |
SET @a:= CAST('111' AS SIGNED ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// =============================================================================== | |
// Microsoft Data Access Application Block for .NET | |
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp | |
// | |
// cs | |
// | |
// This file contains the implementations of the SqlHelper and SqlHelperParameterCache | |
// classes. | |
// | |
// For more information see the Data Access Application Block Implementation Overview. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Data; | |
using MySql.Data.MySqlClient; | |
using System.Linq; | |
using System.Xml; | |
namespace OBALog.Data | |
{ | |
[System.Diagnostics.DebuggerStepThrough] |
NewerOlder