Skip to content

Instantly share code, notes, and snippets.

View jzuijlek's full-sized avatar

Jonathan van Zuijlekom jzuijlek

  • Bridgevest B.V.
View GitHub Profile
@bruvv
bruvv / synology speed tweaks.md
Last active July 15, 2024 18:19
synology speed tweaks

Note: this was tested and used on DSM5 and partly on 6. Since V7 I am not using this anymore.

Got and ssh into your box. Find what is using swap:

find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" -v TOTSWP="$(cat /proc/swaps | sed 1d | awk 'BEGIN{sum=0} {sum=sum+$(NF-2)} END{print sum}')" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") {used_swap=process["VmSwap"];sub(/[ a-zA-Z]+/,"",used_swap);percent=(used_swap/TOTSWP*100); printf "%10s %-30s %20s %6.2f%\n",process["Pid"],process["Name"],process["VmSwap"],percent} }' '{}' \;  | awk '{print $(NF-2),$0}' | sort -hr | head | cut -d " " -f2-

Update synoinfo.conf to correct memory in MB (https://www.gbmb.org/gb-to-mb) for 8GB:

@pshrosbree
pshrosbree / DeserializeAzureEventHubCapture.cs
Last active February 14, 2023 11:06
Deserializing Azure event hub capture files from Apache Avro with C#
/*
NuGet references:
Microsoft.Hadoop.Avro2 (1.2.1 works)
WindowsAzure.Storage (8.3.0 works)
Namespaces:
Microsoft.Hadoop.Avro.Container
Microsoft.WindowsAzure.Storage
*/
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:
@tomhodgins
tomhodgins / queryStrip.js
Last active February 12, 2019 20:58
Deeplink to bootstrap modals, tooltips, popovers, and tabs
$(document).ready(function(){
// queryStrip
function queryStrip(string) {
string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + string + '=([^&#]*)'),
results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ''));
}
@thedamon
thedamon / backbutton close bootstrap modal
Created February 28, 2014 17:59
Cause back button to close Bootstrap modal windows
$('div.modal').on('show', function() {
var modal = this;
var hash = modal.id;
window.location.hash = hash;
window.onhashchange = function() {
if (!location.hash){
$(modal).modal('hide');
}
}
});
@stevewithington
stevewithington / muraMailingListManager.cfm
Created January 20, 2014 20:49
Mura CMS : This is a custom Mailing List Manager example. You could create a custom display object and simply include it on a page somewhere on your site. This example requires the user to log in to sign up.
<cfsilent>
<cfscript>
mailingListName = 'Your Mailing List Name Goes Here';
// MailingListBean : Loading by Mailing List Name
mlBean = $.getBean('mailinglistBean').loadBy(
name=mailingListName
, siteid=$.siteConfig('siteid')
);
mlid = mlBean.getMLID();
@stevewithington
stevewithington / muraUserFeed.cfm
Last active January 3, 2016 21:49
Mura CMS : Example of how to create a user feed bean and loop over the user iterator to output data and extended attributes.
<cfscript>
// USER feed bean
userFeed = $.getBean('userFeed');
// if user(s) belong to a different site, specify desired siteid
// userFeed.setSiteID('someSiteID');
// if you know the groupid, you can filter that
// userFeed.setGroupID('someGroupID', false);
@stevewithington
stevewithington / ajaxData.cfc
Last active November 27, 2018 19:20
Mura CMS : jQuery Ajax example. Sometimes, you'll need to access a file via Ajax in Mura. Some key things to keep in mind are 1) You cannot directly access a .cfm file located under a SiteID unless a) it resides in a directory called 'remote' [as of v6.1], or b) You edit the file located under /{SiteID}/includes/Application.cfc on approximately …
<cfscript>
// Save this file to a path such as /{SiteID}/includes/themes/{ThemeName}/remote/ajaxData.cfc
component {
remote string function getData(siteid='default', contentid='00000000000000000000000000000000001') returnformat='plain' {
var str = '';
var $ = get$(arguments.siteid, arguments.contentid);
savecontent variable='str' {
WriteOutput("<h1>Hello from ajaxData.cfc</h1>