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
execute_process(COMMAND uname -r OUTPUT_VARIABLE UNAME_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE) | |
message(-- " Kernel version: " ${UNAME_RESULT}) | |
string(REGEX MATCH "[0-9]+.[0-9]+" LINUX_KERNEL_VERSION ${UNAME_RESULT}) | |
if (LINUX_KERNEL_VERSION VERSION_LESS 3.8) | |
message(FATAL_ERROR "Linux kernel version should be greater than 3.8") | |
endif() |
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 python3 | |
import socket | |
import time | |
HOST = '10.0.0.1' | |
PORT = 143 | |
while(1): | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: |
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
Language: Cpp | |
Standard: Cpp11 | |
IndentWidth: 4 | |
PointerAlignment: Left | |
ColumnLimit: 90 | |
AllowShortIfStatementsOnASingleLine: true | |
AccessModifierOffset: -4 | |
AlignEscapedNewlinesLeft: true | |
AlignTrailingComments: true | |
AllowShortFunctionsOnASingleLine: true |
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 <utility> | |
// C++14 | |
template <int i1, int i2, typename... Args> | |
auto to_pair(std::tuple<Args...> t) | |
{ | |
return std::make_pair(std::get<i1>(t), std::get<i2>(t)); | |
} | |
// C++11 |
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
.text | |
.global _start | |
_start: | |
mov $2, %eax | |
mov $3, %edx | |
call power | |
mov %eax, %ebx | |
mov $1, %eax |
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
func byteStringToBytes(s *string) []byte { | |
*s = (*s)[1:len(*s) - 1] | |
split := strings.Split(*s, ",") | |
res := make([]byte, len(split)) | |
for i, el := range split { | |
r , _ := strconv.Atoi(el) |
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
{ | |
"bootstrapped": true, | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"GoSublime", | |
"Package Control", | |
"TerminalView" |
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
// example adapterName : {54BB6B17-91C0-4F84-83B2-DE82C525425C} | |
bool setDNS(QString sAdapterName, QString sDNS) | |
{ | |
HKEY hKey; | |
QString strKeyName = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\" + sAdapterName; | |
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, | |
strKeyName.toStdWString().c_str(), | |
0, | |
KEY_WRITE, |