Skip to content

Instantly share code, notes, and snippets.

View ststeiger's full-sized avatar
😎
Back from holidays

Stefan Steiger ststeiger

😎
Back from holidays
  • Switzerland
View GitHub Profile
@ststeiger
ststeiger / nginx.conf
Last active August 29, 2015 14:06 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ststeiger
ststeiger / elasticsearch.sh
Last active August 29, 2015 14:08 — forked from Globegitter/es.sh
ElasticSearch howto
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@ststeiger
ststeiger / DropFKs.sql
Last active August 29, 2015 14:08
Drop Foreign Keys
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_DELDATA_ForeignKeyRelations]'))
DROP VIEW [dbo].[V_DELDATA_ForeignKeyRelations]
GO
CREATE VIEW [dbo].[V_DELDATA_ForeignKeyRelations]
AS
@ststeiger
ststeiger / gist:662da186bf9543fee09d
Last active August 29, 2015 14:09
Generate pseudo-random key-inventory-hook-number in Range 0-999 with 4 digits 0-padding
SELECT
RIGHT('0000' + CAST(ABS(CHECKSUM(T_KeyGroup.KG_No + '.' + T_Key.Key_No)) % 1000 AS varchar(10)), 4) AS RPT_Hook
@ststeiger
ststeiger / NewExecuteCommand.txt
Last active July 20, 2024 00:52
Register an alias for an application in windows run dialog
How to run:
cmd.exe /k start chrome "http://yourWebSite.com
Registring new application
Search order:
- The current working directory.
- The Windows directory only (no subdirectories are searched).
- The Windows\System32 directory.
@ststeiger
ststeiger / ASCII.sql
Created November 13, 2014 13:25
SELECT the ASCII-chart in SQL
;
WITH CTE AS
(
SELECT
0 AS num
,CAST(null AS varchar(100)) AS chr
UNION ALL
SELECT
@ststeiger
ststeiger / SevenZipHelper.cs
Created November 18, 2014 10:22
LZMA-Compression with SevenZip SDK
// http://www.nullskull.com/a/768/7zip-lzma-inmemory-compression-with-c.aspx
// http://www.7-zip.org/sdk.html
namespace SevenZip.Compression.LZMA
{
public static class SevenZipHelper
{
@ststeiger
ststeiger / MoveAspNetProject
Created November 30, 2014 13:23
Error 500.19 after moving ASP.NET project
%userprofile%\Documents\IISExpress\config\applicationhost.config
C:\Users\{Username}\Documents\IISExpress\config\applicationhost.config
Change path in <virtualDirectory path="/" physicalPath="
Have you try to give full permission to your folder? Read and write?
Filename: redirection.config Error: Cannot read configuration file
@ststeiger
ststeiger / CreateLogin.sql
Created December 12, 2014 16:22
Create LOGIN - Remove Login - List role membership for login
IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'techonthenet')
CREATE LOGIN techonthenet
WITH PASSWORD = 'abc'
,DEFAULT_LANGUAGE=English
--,DEFAULT_LANGUAGE=German
--,DEFAULT_LANGUAGE=French
--,DEFAULT_LANGUAGE=Italian
,CHECK_POLICY=OFF
;
GO
@ststeiger
ststeiger / CreateIndexScript
Created December 18, 2014 16:16
Create missing indices
;WITH CTE AS
(
SELECT TOP 99999999
sys.objects.NAME
,(avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) AS Impact
,'CREATE NONCLUSTERED INDEX IX_'
+ sys.objects.name COLLATE DATABASE_DEFAULT
+ '_'