This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (setq gnus-select-method '(nntp "news.gmane.org")) | |
| ;; (setq gnus-select-method '(nntp "news.gwene.org")) | |
| (setq user-full-name "Sajith Sasidharan" | |
| user-mail-address "sajith@hcoop.net") | |
| (setq auth-sources '((:source "~/.authinfo.gpg"))) | |
| (setq mml-secure-openpgp-signers '("0x0C6DA6A29D5F02BA") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdlib> | |
| // Run this with: | |
| // for c in `seq 0 256`; do ./return $c ; echo $?; done | |
| int main(int argc, char *argv[]) | |
| { | |
| if (argc > 1) | |
| return strtol(argv[1], 0, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; This does not work! | |
| (setq user-mail-address "sajith@hcoop.net" | |
| user-full-name "Sajith Sasidharan") | |
| ;; (setq gnus-ignored-newsgroups "") | |
| ;; (setq starttls-gnutls-program "/usr/local/bin/gnutls-cli") | |
| (setq gnus-select-method '(nnnil "")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cassert> | |
| #include <iostream> | |
| #include <set> | |
| #include <stdexcept> | |
| #include <net/if.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| std::set<std::string> getInterfaceNames() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This code is straight from getifaddrs(3) manpage. | |
| #ifndef _GNU_SOURCE | |
| #define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */ | |
| #endif | |
| #include <arpa/inet.h> | |
| #include <sys/socket.h> | |
| #include <netdb.h> | |
| #include <ifaddrs.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cassert> | |
| #include <stdexcept> | |
| #include <unistd.h> | |
| #include "mounts.h" | |
| static const char* const _PATH_PROC_MOUNTINFO = "/proc/self/mountinfo"; | |
| static const char* const _PATH_PROC_MOUNTS = "/proc/mounts"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef BDE_UTILS_MOUNT_H | |
| #define BDE_UTILS_MOUNT_H | |
| #include <set> | |
| #include <string> | |
| #include <cassert> | |
| #include <libmount/libmount.h> | |
| namespace utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdexcept> | |
| #include <getopt.h> | |
| #include "mounts.h" | |
| // TODO: if a path is given, and nothing is mounted on it, find its | |
| // parent. | |
| // TODO: handle multiple inputs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| URL = https://www.kernel.org/pub/linux/utils/util-linux/v2.27/util-linux-2.27.tar.xz | |
| LIBPATH = /tmp/util-linux-install | |
| CXXFLAGS += -Wall -ggdb -std=c++11 | |
| CPPFLAGS += -I$(LIBPATH)/include | |
| LIBMOUNT := $(LIBPATH)/lib/libmount.a | |
| LIBBLKID := $(LIBPATH)/lib/libblkid.a | |
| PROGRAM = mounts-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cassert> | |
| #include <getopt.h> | |
| #include <unistd.h> | |
| #include <libmount/libmount.h> | |
| #define _PATH_PROC_MOUNTINFO "/proc/self/mountinfo" | |
| #define _PATH_PROC_MOUNTS "/proc/mounts" |