Skip to content

Instantly share code, notes, and snippets.

View rbgarga's full-sized avatar

Renato Botelho rbgarga

View GitHub Profile
@rbgarga
rbgarga / binary.txt
Created September 28, 2022 17:51
strace Ubuntu 22.04 systemd reboot vs reboot binary on Lenovo ThinkPad x230
# strace ./reboot
execve("./reboot", ["./reboot"], 0x7ffd5f55b8e0 /* 31 vars */) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0x7f45c50f8000
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
sync() = 0
reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_CAD_OFF) = 0
reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART
@rbgarga
rbgarga / gist:910f0a062f0d17a19092231842935999
Created September 28, 2022 17:49
Ubuntu 22.04 systemd reboot on Lenovo ThinkPad x230
# strace reboot
execve("/usr/sbin/reboot", ["reboot"], 0x7ffc2ad73e60 /* 27 vars */) = 0
brk(NULL) = 0x55d4ae24a000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc202f2740) = -1 EINVAL (Invalid argument)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6cb2f8a000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/systemd/glibc-hwcaps/x86-64-v2/libcap.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/systemd/glibc-hwcaps/x86-64-v2", 0x7ffc202f1960, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/systemd/tls/x86_64/x86_64/libcap.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/systemd/tls/x86_64/x86_64", 0x7ffc202f1960, 0) = -1 ENOENT (No such file or directory)
@rbgarga
rbgarga / git.txt
Created April 23, 2020 18:04
git weirdness
>>> I see the commit 53e5b36834f1 is present on current branch (RELENG_2_4_5)
❯ git log RELENG_2_4_5 | grep -A5 53e5b36834f1 ✘ 130
commit 53e5b36834f1
Author: jim-p <jimp@netgate.com>
Date: Fri Jan 3 11:50:09 2020 -0500
Allow sshguard to process via stdin again. Issue #9971
>>> And this commit changed file 'security/sshguard/files/patch-src_sshguard.in'
@rbgarga
rbgarga / rc.conf
Created August 23, 2019 13:03
Failover between ethernet and wifi on FreeBSD
ifconfig_em0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
# Configure wifi interface with the same mac address of em0
create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
diff --git a/security/pfSense-pkg-suricata/Makefile b/security/pfSense-pkg-suricata/Makefile
index b465ba0c87f0..23e621ff992e 100644
--- a/security/pfSense-pkg-suricata/Makefile
+++ b/security/pfSense-pkg-suricata/Makefile
@@ -21,6 +21,8 @@ NO_MTREE= yes
SUB_FILES= pkg-install pkg-deinstall
SUB_LIST= PORTNAME=${PORTNAME}
+.include <bsd.port.pre.mk>
+
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index b35964d7ab..4c60f9409e 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -2093,7 +2093,8 @@ function interface_ppps_configure($interface) {
}
}
- if (is_array($ports) && count($ports) > 1) {
+ if (isset($ppp['pppoe-multilink-over-singlelink']) ||
Index: Makefile
===================================================================
--- Makefile (revision 472086)
+++ Makefile (working copy)
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= clixon
-DISTVERSION= 3.6.0.b.20180424
+PORTVERSION= 3.6.1
commit 13483e166cefe36e5ad58e66350a61aab0a0bdea
Author: Renato Botelho <garga@FreeBSD.org>
Date: Thu May 10 16:20:24 2018 -0300
Fix pkg_delete_all() using a proper binary
diff --git a/sysutils/pfSense-upgrade/Makefile b/sysutils/pfSense-upgrade/Makefile
index 198b2781fed8..38d80c8cd348 100644
--- a/sysutils/pfSense-upgrade/Makefile
+++ b/sysutils/pfSense-upgrade/Makefile
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 387fea99da..69cb9c9f8e 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2281,19 +2281,22 @@ function system_check_reset_button() {
$specplatform = system_identify_specific_platform();
switch ($specplatform['name']) {
+ case 'SG-2220':
+ $binprefix = "RCC-DFF";
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc
index 55dd3b0901..3a4e97ccd6 100644
--- a/src/etc/inc/util.inc
+++ b/src/etc/inc/util.inc
@@ -2425,7 +2425,8 @@ function route_add_or_change($args) {
}
/* First, try to add it */
- $_gb = exec(escapeshellcmd("/sbin/route add " . $args), $output, $rc);
+ $_gb = exec(escapeshellcmd("/sbin/route add " . $args . " 2>/dev/null"),