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 / How_to_disable_jcef.txt
Last active July 21, 2024 14:32
JetBrains Rider disable jcef jcef.enabled
./options/ide.general.xml: <entry key="ide.browser.jcef.enabled" value="false" />
/root/.config/JetBrains/Rider2024.2/options/ide.general.xml
<application>
<component name="GeneralSettings">
<option name="reopenLastProject" value="false" />
<option name="confirmExit" value="false" />
@ststeiger
ststeiger / FileRightsModifier.cs
Created June 5, 2024 11:32
Give full rights to everyone
namespace HubSpotClient.Trash
{
internal class FileRightsModifier
{
@ststeiger
ststeiger / Maddy_SSL.sh
Created June 1, 2024 16:45
Maddy SSL Configuration
# Create a private key for example.int:
# Generate a private key for the domain example.int:
openssl genpkey -algorithm RSA -out /etc/maddy/certs/example.int/privkey.pem -pkeyopt rsa_keygen_bits:2048
# Generate a CSR for example.int:
# Create a Certificate Signing Request (CSR) using the private key:
openssl req -new -key /etc/maddy/certs/example.int/privkey.pem -out /etc/maddy/certs/example.int/example.int.csr -subj "/C=US/ST=California/L=San Francisco/O=My Company/OU=IT Department/CN=example.int"
@ststeiger
ststeiger / View_Dependencies.sql
Created May 28, 2024 16:14
List view-dependencies in MS-SQL
SELECT DISTINCT referenced_schema_name, referenced_entity_name
FROM sys.dm_sql_referenced_entities('dbo.V_COR_Objekte_Kategorien', 'OBJECT')
WHERE (1=1)
-- AND referenced_entity_name NOT IN('T_OV_Ref_ObjektTyp', 'T_SYS_ApertureColorToHex')
ORDER BY referenced_entity_name
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@ststeiger
ststeiger / SSMS_Zoom.md
Created May 15, 2024 11:41
SSMS Zoom View
@ststeiger
ststeiger / Trigger_Status.sql
Created April 29, 2024 12:37
Trigger Status Information
SELECT
sch.name AS table_schema
,tbl.name AS table_name
,trig.name AS trigger_name
,trig.is_disabled
,CASE WHEN is_disabled = 0 THEN 'Enabled' ELSE 'Disabled' END trigger_Status
FROM sys.triggers AS trig
LEFT JOIN sys.tables AS tbl ON tbl.object_id = trig.parent_id
LEFT JOIN sys.schemas AS sch ON sch.schema_id = tbl.schema_id
@ststeiger
ststeiger / Computed_Columns_Index.sql
Created April 25, 2024 14:09
List indexes on computed columns
SELECT
ind.name
,sch.name
,obj.name
,sc.name
,sc.is_computed AS is_computed
,tbl_computed_columns.definition AS computation
@ststeiger
ststeiger / Generate_Indexes.sql
Created April 18, 2024 14:43
Index Generation script
SELECT
ind.name
,'DROP INDEX ' + QUOTENAME
(
CASE WHEN SUBSTRING(ind.name, 1, 2) = 'ix' THEN 'IX' + SUBSTRING(ind.name, 3, 10000) ELSE ind.name END
) + ' ON ' + QUOTENAME(sch.name) + '.' + QUOTENAME(obj.name) + '; ' AS DropIndexScript
, ' CREATE '
@ststeiger
ststeiger / ffmpeg_split.sh
Created April 2, 2024 15:06
Split all screens video into single screen
Simply convert:
ffmpeg -i input.avi output.mp4
Simply convert, but only the left half of the screen(s):
ffmpeg -i input.avi -filter_complex "[0:v]crop=iw/2:ih:0:0,scale=iw:ih[out]" -map "[out]" output.mp4
Simply convert, but only the right half of the screen(s):
ffmpeg -i input.avi -filter_complex "[0:v]crop=iw/2:ih:ow:0,scale=iw:ih[out]" -map "[out]" output.mp4