Skip to content

Instantly share code, notes, and snippets.

View clemensg's full-sized avatar

Clemens Gruber clemensg

View GitHub Profile
@clemensg
clemensg / clang-format-problem-1.c
Last active February 10, 2020 13:30
Bug 34649 - clang-format messes up comment indentations - Problem 1
unsigned int
/* a = 1, */ /* Comment A */
b = 2, /* Comment B */
c = 3; /* Comment C */
int main(int argc, char *argv[])
{
return 0;
}
@clemensg
clemensg / .clang-format
Created November 29, 2017 10:45
Bug 34649 - clang-format messes up comment indentations - .clang-format
BasedOnStyle: Google
IndentWidth: 2
TabWidth: 8
UseTab: Never
ContinuationIndentWidth: 4
IndentCaseLabels: true
BreakBeforeBraces: Allman
ColumnLimit: 0
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
@clemensg
clemensg / clang-format-problem-3.c
Created November 29, 2017 10:41
Bug 34649 - clang-format messes up comment indentations - Problem 3
void main(void)
{
if (1)
{
/* Comment */
#ifdef FOO
printf("bar");
#endif
}
}
@clemensg
clemensg / clang-format-problem-2.c
Created November 29, 2017 10:13
Bug 34649 - clang-format messes up comment indentations - Problem 2
void main(void)
{
int a = 1;
/* FOO begins */
#ifndef FOO
if (a)
{
return;
}
@clemensg
clemensg / nginx.service
Created November 22, 2017 22:08
Example nginx service file for systemd
[Unit]
Description=NGINX HTTP and reverse proxy server
After=syslog.target network.target nss-lookup.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/bin/kill -s HUP $MAINPID
@clemensg
clemensg / BusyBox-stty-Add-RS485-config-options.patch
Created January 7, 2017 13:30
Patch for Busybox 1.25.1 to add RS-485 configuration to stty
From: Clemens Gruber <clemens.gruber@pqgruber.com>
Date: Thu, 4 Aug 2016 14:51:44 +0200
Subject: [PATCH] stty: RS-485 support
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
coreutils/stty.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 150 insertions(+), 9 deletions(-)
diff --git a/coreutils/stty.c b/coreutils/stty.c
@clemensg
clemensg / imx_rs485_kernel_log.txt
Created January 4, 2017 14:42
Linux 4.9 kernel log during echo A > /dev/ttymxc4 followed by echo B > /dev/ttymxc4
[ 29.059025] mxs-dma 110000.dma-apbh: private_candidate: wrong capabilities
[ 29.059042] imx-sdma 20ec000.sdma: private_candidate: dma1chan0 busy
[ 29.059054] imx-sdma 20ec000.sdma: private_candidate: dma1chan1 busy
[ 29.059149] dmaengine: __dma_request_channel: success (dma1chan2)
[ 29.059168] imx-sdma 20ec000.sdma: load_address = 6722
[ 29.059177] imx-sdma 20ec000.sdma: wml = 0x00000008
[ 29.059187] imx-sdma 20ec000.sdma: shp_addr = 0x021f4000
[ 29.059197] imx-sdma 20ec000.sdma: per_addr = 0x00000000
[ 29.059206] imx-sdma 20ec000.sdma: event_mask0 = 0x00000000
[ 29.059215] imx-sdma 20ec000.sdma: event_mask1 = 0x00000002
@clemensg
clemensg / kernel_log_1.txt
Created January 4, 2017 14:36
Kernel log during first test: echo A > /dev/ttymxc4
[ 52.193765] mxs-dma 110000.dma-apbh: private_candidate: wrong capabilities
[ 52.193782] imx-sdma 20ec000.sdma: private_candidate: dma1chan0 busy
[ 52.193794] imx-sdma 20ec000.sdma: private_candidate: dma1chan1 busy
[ 52.193968] dmaengine: __dma_request_channel: success (dma1chan2)
[ 52.193987] imx-sdma 20ec000.sdma: load_address = 6722
[ 52.193997] imx-sdma 20ec000.sdma: wml = 0x00000008
[ 52.194007] imx-sdma 20ec000.sdma: shp_addr = 0x021f4000
[ 52.194017] imx-sdma 20ec000.sdma: per_addr = 0x00000000
[ 52.194025] imx-sdma 20ec000.sdma: event_mask0 = 0x00000000
[ 52.194034] imx-sdma 20ec000.sdma: event_mask1 = 0x00000002
@clemensg
clemensg / gist:7d7b276dd12212491a3b
Created December 31, 2015 15:39
cocoapods-core 1.0.0.beta1 with Ruby 2.3.0 on OS X 10.11
--------------------------------------------------------------------------------
Running Unit Tests
--------------------------------------------------------------------------------
bundle exec bacon spec/podfile/target_definition_spec.rb spec/specification/linter/result_spec.rb spec/github_spec.rb spec/http_spec.rb spec/yaml_helper_spec.rb spec/specification/dsl/platform_proxy_spec.rb spec/platform_spec.rb spec/version_spec.rb spec/specification/set_spec.rb spec/dependency_spec.rb spec/specification/consumer_spec.rb spec/specification/set/presenter_spec.rb spec/requirement_spec.rb spec/podfile_spec.rb spec/source/health_reporter_spec.rb spec/specification/root_attribute_accessors_spec.rb spec/specification/dsl/attribute_spec.rb spec/source_spec.rb spec/lockfile_spec.rb spec/specification/json_spec.rb spec/specification/linter/analyzer_spec.rb spec/specification/dsl/attribute_support_spec.rb spec/source/aggregate_spec.rb spec/specification_spec.rb spec/specification/dsl/deprecations_spec.rb spec/standard_erro
@clemensg
clemensg / vmware-10.0.3.patch
Created July 4, 2014 13:35
VMware Workstation 10.0.3 modules patch on Linux 3.15, apply in addition to http://pastie.org/9090538
diff -ur vsock-only/linux/notify.c ~vsock-only/linux/notify.c
--- vsock-only/linux/notify.c 2014-07-04 15:12:12.286408886 +0200
+++ ~vsock-only/linux/notify.c 2014-07-04 15:13:16.573315661 +0200
@@ -516,7 +516,7 @@
PKT_FIELD(vsk, sentWaitingRead) = FALSE;
#endif
- sk->sk_data_ready(sk, 0);
+ sk->sk_data_ready(sk);
}