Skip to content

Instantly share code, notes, and snippets.

@mpslanker
mpslanker / compiling_building_c_cpp_notes.md
Created September 12, 2019 04:37 — forked from gubatron/compiling_building_c_cpp_notes.md
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015; August 29, 2019.

Include Paths

On the compilation phase, you will usually need to specify the different include paths so that the interfaces (.h, .hpp) which define structs, classes, constans, and functions can be found.

With gcc and llvm include paths are passed with -I/path/to/includes, you can pass as many -I as you need.

In Windows, cl.exe takes include paths with the following syntax: /I"c:\path\to\includes\ you can also pass as many as you need.

@mpslanker
mpslanker / gentoo-installer.sh
Last active August 17, 2019 06:43 — forked from sormy/gentoo-installer.sh
gentoo quick install script
#!/bin/bash
set -e
GENTOO_RELEASES_URL=http://distfiles.gentoo.org/releases
GENTOO_ARCH=amd64
GENTOO_VARIANT=amd64
TARGET_DISK=/dev/sda

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
# CentOS 7 Template Prep
# Taken from here:
# https://community.spiceworks.com/how_to/151558-create-a-rhel-centos-6-7-template-for-vmware-vsphere
# Update everything but skip broken
yum update --skip-broken -y
# Stop logging services
/sbin/service rsyslog stop
/sbin/service auditd stop
configure
delete system name-server
set system name-server 127.0.0.1
Since you are getting an IP on your WAN address via DHCP, you'll need to tell the dhcp-client not to add the ISP DNS servers to /etc/resolv.conf.
set interfaces ethernet eth0 dhcp-options name-server no-update
By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers that are known to be up. If you want to query the servers in order instead, then add the following:
set service dns forwarding options strict-order
@mpslanker
mpslanker / Mac OS X 10_5_ Windows Ctrl.xml
Created May 4, 2018 14:50 — forked from fljot/Mac OS X 10_5_ Windows Ctrl.xml
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">
Just three simple steps:
docker login --username username --password password
docker tag my-image username/my-repo
docker push username/my-repo
courtesy of Abhishek Dasgupta
-- https://stackoverflow.com/questions/28349392/how-to-push-a-docker-image-to-a-private-repository
@mpslanker
mpslanker / code.md
Created September 30, 2017 04:41 — forked from weakish/code.md
The Six Most Common Species Of #Code #java #fun
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> get_scores()
{
vector<int> ret(3);
When installing from the RailsInstaller (or any place that causes this issue)
you might receive an SSL error when trying to update or install gems
Perform the following steps to update the gems system
gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
gem update --system
gem install rails -v 4.2.3