Skip to content

Instantly share code, notes, and snippets.

View rjaeckel's full-sized avatar

Robert Jäckel rjaeckel

  • IT-Servicezentrum, Uni Halle
View GitHub Profile
@alexsorokoletov
alexsorokoletov / uwp_image_convert_to_jpeg_quality.cs
Created May 23, 2016 02:03
How to convert image to JPEG and specify quality (q) parameter in UWP C# XAML
/// <summary>
/// Converts source image file to jpeg of defined quality (0.85)
/// </summary>
/// <param name="sourceFile">Source StorageFile</param>
/// <param name="outputFile">Target StorageFile</param>
/// <returns></returns>
private async Task<StorageFile> ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile)
{
//you can use WinRTXamlToolkit StorageItemExtensions.GetSizeAsync to get file size (if you already plugged this nuget in)
var sourceFileProperties = await sourceFile.GetBasicPropertiesAsync();
@rjaeckel
rjaeckel / 0_info.md
Last active April 29, 2020 06:26
Apache and nginx ciphersuite settings
  • generic cipher suites to be used:

    For Apache2.2: this enables FS on all clients ALL:!COMPLEMENTOFDEFAULT:!EXPORT:!LOW:!MD5:!aNull:!eNull:!RC4:-3DES:+ECDHE:+RSA:!DH

    Apache 2.4 with Current openssl:

    SSLCipherSuite aRSA+CHACHA20:aRSA:!kPSK:!kRSAPSK:!SHA:!NULL:!CAMELLIA:+kECDH:+kEDH:+SHA384:+SHA256:!kRSA EECDH+CHACHA20:EDH+CHACHA20:EECDH+AESGCM:EDH+AESGCM:EECDH+AES256

@lemenkov
lemenkov / restore_mysql
Last active February 17, 2016 09:03
How to restore/reset MySQL password
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
mysql> FLUSH PRIVILEGES;
^D
killall mysqld
/etc/init.d/mysqld start
@rjaeckel
rjaeckel / curl-http-status-cron.sh
Created April 2, 2014 07:11
curl-http-status-cron
#!/bin/bash
curl=/usr/bin/curl
hosts="www.vk.uni-halle.de www.wissenschaftsnacht-halle.de"
for host in $hosts; do
http_status=$($curl curl -sI --get http://$host | head -n1 | awk '{print $2}' )
if [[ "$http_status" -ne "200" ]]; then
echo "Host $host returned status '$http_status'"
fi
@andrewytliu
andrewytliu / config.fish
Last active February 19, 2020 10:26
RVM fish fix
# in ~/.config/fish/config.fish
# Load the default rubies
if test -z $rvm_bin_path
exec bash --login -c "exec fish" ^&1
end
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#