Skip to content

Instantly share code, notes, and snippets.

@bigga
bigga / enterprise_token.rb
Created March 13, 2024 18:23 — forked from markasoftware/enterprise_token.rb
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@bigga
bigga / gist:f9c5fc6d8af5a8380f785b310ce0642c
Created June 29, 2022 04:09
Append all csv files without header
#https://apple.stackexchange.com/questions/80611/merging-multiple-csv-files-without-merging-the-header
awk '(NR == 1) || (FNR > 1)' *.csv > out.csv
@bigga
bigga / gist:fd0b3d19ed1a59093fe97644b4a0b529
Last active June 29, 2022 03:54
Convert Windows-874 to UTF-8
#Output filename comes BEFORE the input name
iconv -f WINDOWS-874 -t UTF-8//TRANSLIT -o out_file.txt in_file.txt
@bigga
bigga / gist:5263c31c85428843f0f00260e5d2ab01
Created June 29, 2022 03:40 — forked from t3chnoboy/gist:8322246
Convert all files in folder to utf-8 using iconv
# http://stackoverflow.com/questions/4544669/batch-convert-latin-1-files-to-utf-8-using-iconv
find . -type f -exec bash -c 'iconv -f iso-8859-1 -t utf-8 "{}" > /path/to/destination/"{}"' \;
@bigga
bigga / PowerShell - File Spliting.ps1
Last active April 6, 2022 08:52
PowerShell - File Spliting
#split test
$sw = new-object System.Diagnostics.Stopwatch
$sw.Start()
$filename = "IN_FILENAME.ext"
$rootName = "OUT_FILENAME_"
$ext = "ext"
$linesperFile = 2000#2k
$filecount = 1
$reader = $null
@bigga
bigga / Split-File.ps1
Created March 29, 2022 15:19 — forked from awayken/Split-File.ps1
Split files using Powershell, modified from: http://stackoverflow.com/a/11010158/215200
# Modified from: http://stackoverflow.com/a/11010158/215200
$fromFolder = "D:\FOLDER\"
$rootName = "FILENAME"
$ext = "EXT"
$from = "{0}{1}.{2}" -f ($fromFolder, $rootName, $ext)
$fromFile = [io.file]::OpenRead($from)
$upperBound = 100MB
@bigga
bigga / split.bat
Created March 29, 2022 14:10
Split Files Batch
@echo off
setlocal ENABLEDELAYEDEXPANSION
REM Edit this value to change the name of the file that needs splitting. Include the extension.
REM Edit this value to change the number of lines per file.
SET LPF=5000
REM Edit this value to change the name of each short file. It will be followed by a number indicating where it is in the list.
SET SFN=%~n1
SET SFX=%~x1
@bigga
bigga / geoserver.service
Last active July 3, 2019 16:50
Geoserver service file to run as a service in CentOS
# This snippet is copied from: http://supadit.com/article/%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-geoserver-%E0%B8%9A%E0%B8%99-centos
# The site is already down. So I keep the code as reference here.
# To run Geoserver as a service in CentOS, first install Geoserver, obviously
# Then, put this script into /etc/systemd/system/
# You can also run this command and copy and paste the content below.
# vi /etc/systemd/system/geoserver.service
# After creating the script, you can run the following commands to start and check the service
# systemctl daemon-reload
@bigga
bigga / geoserver-install.sh
Last active June 21, 2019 08:22 — forked from iacovlev-pavel/geoserver-install.sh
Install GeoServer on Ubuntu 18.04
#Updated to cover Geoserver 2.15.1
#Added sudo to apt-get lines
sudo apt-get update
sudo apt-get install openjdk-8-jre
# PostgreSQL and PostGIS
sudo apt-get install postgresql postgresql-contrib postgis postgresql-10-postgis-2.4
# Create "geoserver" database
@bigga
bigga / geoserver-startup.sh
Last active July 20, 2019 10:10 — forked from iacovlev-pavel/geoserver-startup.sh
Geoserver init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: geoserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: GeoServer OGC server
### END INIT INFO