Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar

Krzysztof Wilczyński kwilczynski

  • Yokohama, Japan
  • 13:14 (UTC +09:00)
View GitHub Profile
@muff-in
muff-in / resources.md
Last active July 10, 2025 04:38
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@kwilczynski
kwilczynski / callback.c
Last active March 22, 2021 00:38
PM driver callbacks helper
// Using the && (logical AND) operator.
#define pm_driver_has_callback(__device, __callback) \
((__device)->driver && (__device)->driver->pm && (__device)->driver->pm->__callback)
#define pm_driver_do_callback(__device, __callback) \
(pm_driver_has_callback(__device, __callback) ? (__device)->driver->pm->__callback(__device) : 0)
// Using a statement expression to avoid using ternary operator...
@kwilczynski
kwilczynski / Vagrantfile
Last active May 11, 2022 13:51
Vagrant box ubuntu/focal64 and Ubuntu 20.04 freezing on vagrant up - fix by enabling serial console writing to /dev/null.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.provider "virtualbox" do |vb|
vb.customize [ "modifyvm", :id, "--uartmode1", "file", "/dev/null" ]
end
end
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 14, 2025 19:32
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@kwilczynski
kwilczynski / dmesg.txt
Last active March 22, 2021 00:29
The amazing mini-PC S200 with i9-9880H from EGLOBAL
[ 5.250222] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[ 5.255513] ------------[ cut here ]------------
[ 5.255514] WARN_ON(!IS_PLATFORM(dev_priv, INTEL_SKYLAKE) && !IS_PLATFORM(dev_priv, INTEL_KABYLAKE))
[ 5.255562] WARNING: CPU: 3 PID: 518 at drivers/gpu/drm/i915/i915_drv.c:192 intel_pch_type+0x1f3/0x5f0 [i915]
[ 5.255563] Modules linked in: i915(+) snd_hda_intel snd_intel_nhlt snd_hda_codec drm_kms_helper snd_hda_core drm snd_hwdep snd_pcm i2c_algo_bit snd_timer fb_sys_fops snd syscopyarea intel_rapl_perf(+) sysfillrect sysimgblt soundcore input_leds intel_pch_thermal pcspkr intel_wmi_thunderbolt serio_raw topstar_laptop sparse_keymap acpi_pad acpi_tad fjes(-) mac_hid zcommon(PO+) znvpair(PO) spl(O) vhost_net vhost tap ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi sunrpc scsi_transport_iscsi ip_tables x_tables autofs4 xfs btrfs xor zstd_compress raid6_pq libcrc32c psmouse i2c_i801 r8169 ahci realtek libahci wmi video
[ 5.255579] CPU: 3 PID: 518 Comm:
kwilczynski@ubuntu:~$ grpcurl kw-alpha4.us-east1.apps.lbcs.io:443 describe
com.example.myservice.MyService is a service:
service MyService {
rpc AddItem ( .com.example.myservice.MyAddItem ) returns ( .google.protobuf.Empty ) {
option (.google.api.http) = { post:"/state/{user_id}/items/add" body:"*" };
}
rpc GetState ( .com.example.myservice.MyGetState ) returns ( .com.example.myservice.MyState ) {
option (.google.api.http) = { get:"/state/{user_id}" additional_bindings:<get:"/state/{user_id}/items" response_body:"items" > };
}
rpc RemoveItem ( .com.example.myservice.MyRemoveItem ) returns ( .google.protobuf.Empty ) {
@smallnest
smallnest / fork_and_daemon.go
Created April 20, 2020 06:52 — forked from wrfly/fork_and_daemon.go
golang fork and exec and handle signals
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
)
@kwilczynski
kwilczynski / test.md
Last active March 22, 2021 00:25
Scala documentation markdown italics issue

Problems with italics and the code blocks (inline or otherwie).

Given:

`test _test_`

```
test _test_
```
@kwilczynski
kwilczynski / ipvs-thundering-herd-3.0.patch
Last active March 22, 2021 00:23
Linux IPVS thundering herd mitigation
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index 4deb383..3d4e7af 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -27,6 +27,18 @@
#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */
#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */
+ /*
+ * Advisory flags for slow start.
import (
"github.com/aelsabbahy/goss/outputs"
"github.com/aelsabbahy/goss/util"
)
func TestUseAsPackage(t *testing.T) {
output := &bytes.Buffer{}
// temp spec file
fh, err := ioutil.TempFile("", "*.yaml")