weird.c
--------------
#include<stdio.h>
int main(){
int i = 4;
char c = i["ABCDEF"];
printf("%c", c);
return 0;
}
This file contains 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
Aug 10 20:17:07 HOSTNAME sudo[1343]: USERNAME : TTY=pts/0 ; PWD=/home/USERNAME ; USER=root ; COMMAND=/usr/bin/systemctl restart systemd-logind.service | |
Aug 10 20:17:07 HOSTNAME sudo[1343]: pam_unix(sudo:session): session opened for user root by (uid=0) | |
Aug 10 20:17:07 HOSTNAME systemd[1]: Stopping Login Service... | |
Aug 10 20:17:07 HOSTNAME systemd[1]: Stopped Login Service. | |
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,67: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX | |
Aug 10 20:17:07 HOSTNAME systemd[1]: Starting Login Service... | |
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,71: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX | |
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,72: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX | |
Aug 10 2 |
This file contains 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
With custom routes in a custom ovpn file, NetworkManager reports with | |
`Error: configuration error: unsupported 1th argument to "route" which looks like a FQDN but only IPv4 address supported (line XX)` | |
Looks like the `route` config option is not available in NM ovpn config but the alternative `route-data` can be used. | |
The syntax remains the same: | |
`route-data IP netmask gateway` |
This file contains 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
#!/bin/bash | |
# (C) Hritik Vijay | |
# License: GPLv2 | |
Table=200 | |
route_cmd="ip route add default scope global " | |
# Iterate through each interface and process them | |
while read -r line; do | |
P=$(echo $line | grep -Eo 'via [0-9\.]+ ' | cut -d " " -f 2) |
Hi there. Welcome to my channel.
Here we will solve Rach's dilemma.
Ready ?
You may jump to Tl;dr
Consider this program:
#include<stdio.h>
int main(){
This file contains 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<stdio.h> | |
#include<string.h> | |
/* | |
* bitwisei -- decimal to binary using bitwise operators | |
* masks n with 0001 | |
* then with 0010 | |
* then with 0100 | |
* then with 100 | |
* in order to find out if the corresponding bit is on in n |
This file contains 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<stdio.h> | |
#include<string.h> | |
#define HEX_SIZE 7 | |
/* | |
* converts hex to bin | |
* bin MUST be able to accomodate hex_size*4 elements | |
*/ | |
int hex2bin(char* bin, char* hex, size_t hex_size ){ | |
int i; |
This file contains 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
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
#CHANGE THIS | |
AWS_FUNCTION_NAME=routine | |
_green(){ | |
echo -e "\033[32m$1\033[0m" | |
} |
Of course, start with reading https://www.kernel.org/doc/html/latest/process/coding-style.html
Install YCM by
cd ~/.vim/pack/*/start/
git submodule add https://github.com/ycm-core/YouCompleteMe
or
git clone https://github.com/ycm-core/YouCompleteMe
This file contains 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
#!/bin/bash | |
build_image() { | |
local out=$1 compress=$2 errmsg pipestatus | |
case $compress in | |
cat) | |
msg "Creating uncompressed initcpio image: %s" "$out" | |
unset COMPRESSION_OPTIONS | |
;; |
OlderNewer