Skip to content

Instantly share code, notes, and snippets.

select pg_get_serial_sequence('lookup.state','id') -- get seq for table and id
select currval('lookup.state_id_seq'); -- current value
select nextval('lookup.state_id_seq'); -- next value
--restart value
ALTER SEQUENCE lookup.state_id_seq RESTART WITH 563;
cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF
@dexalex84
dexalex84 / makemac.sh
Last active October 26, 2018 19:34
make mac for kvm
date +%s | md5sum | { read test; echo ${test:1:6}; } | sed -e 's/\([0-9A-Fa-f]\{2\}\)/\1:/g' -e 's/\(.*\):$/\1/' | sed -e 's/^/52:54:00:/'
@dexalex84
dexalex84 / gist:8e2fb8d5d3ea29d535582ab5ef4b3bd7
Created May 5, 2017 11:58
Building pentaho from source ver 1
Pentaho Kettle build from github source
1) create folder
2) git init in that folder
3) git add remote https://github.com/pentaho/pentaho-kettle.git
4) git pull origin <major-ver>("6.0" or "6.1" or "master" etc) for example "git pull origin 6.1"
5) install jdk
6) ADD to Enviroment Variables:
JAVA_HOME = apth to JDK folder
JAVA_TOOL_OPTION -Dfile.encoding=UTF8
7) install apache ant from https://ant.apache.org/
@dexalex84
dexalex84 / gist:0a1789930ed00dfcd0713ce1ffcb47a0
Created May 3, 2017 09:17
MSSQL Inspect transation log
https://www.mssqltips.com/sqlservertip/3076/how-to-read-the-sql-server-database-transaction-log/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=20170503
select [Current LSN],
[Operation],
[Transaction Name],
[Transaction ID],
[Transaction SID],
[SPID],
[Begin Time]
1) Hw to install
https://about.gitlab.com/downloads/#ubuntu1604
2) How to change root password
https://docs.gitlab.com/ee/security/reset_root_password.html
most important to find sources (.deb) to you system OS build!!
@dexalex84
dexalex84 / gist:1551e88273b7393d91a65cfa6671fe3d
Last active April 29, 2017 16:46
MSSQL 2017 Install on docker
https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-docker
1) Install docker. Create docker-compose.yml
version: "3"
services:
db_mssql:
image: microsoft/mssql-server-linux
container_name: db_mssql
ports:
- 1433:1433
environment:
@dexalex84
dexalex84 / gist:71396f76d042c753f0ec0d13979ecf5b
Created April 29, 2017 16:15
MSSQL 2016 Temporal tables EXAMPLE
-- drop
if object_id ('dbo.person') is not null
begin
ALTER TABLE dbo.person SET (SYSTEM_VERSIONING = OFF)
DROP TABLE dbo.person
end
if object_id ('dbo.person_history') is not null
DROP TABLE dbo.person_history
@dexalex84
dexalex84 / gist:559e9112e7ea43d39f5c284c8e98fb5c
Created April 29, 2017 16:01
NEWSEQUENTIALID - better to use with clustered index
"Creates a GUID that is greater than any GUID previously generated by this function on a specified computer since Windows was started.
After restarting Windows, the GUID can start again from a lower range, but is still globally unique. "
@dexalex84
dexalex84 / gist:254072dde1b02e4a078ed605ffbf9c47
Created April 29, 2017 11:34
Turn On Nested Virtualisation on Windows Host
Prerequisites
A Hyper-V host running Windows Server 2016 or Windows 10 Anniversary Update;
A Hyper-V VM running Windows Server 2016 or Windows 10 Anniversary Update;
A Hyper-V VM with configuration version 8.0 or greater;
An Intel processor with VT-x and EPT technology.
Configure Nested Virtualisation
Create a virtual machine.
While the virtual machine is in the OFF state, run the following command on the physical Hyper-V host. This enables nested virtualisation for the virtual machine.
Set-VMProcessor -VMName "<Your Virtual Machine Name>" -ExposeVirtualizationExtensions $true
Start the virtual machine.