Archive

Archive for May, 2019

Compile C++11 on MacOS / XCode

May 7th, 2019 No comments

By https://stackoverflow.com/questions/14228856/how-to-compile-c-with-c11-support-in-mac-terminal

As others have pointed out you should use clang++ rather than g++. Also, you should use the libc++ library instead of the default libstdc++; The included version of libstdc++ is quite old and therefore does not include C++11 library features.

clang++ -std=c++11 -stdlib=libc++ -Weverything main.cpp

If you haven’t installed the command line tools for Xcode you can run the compiler and other tools without doing that by using the xcrun tool.

xcrun clang++ -std=c++11 -stdlib=libc++ -Weverything main.cpp

Also if there’s a particular warning you want to disable you can pass additional flags to the compiler to do so. At the end of the warning messages it shows you the most specific flag that would enable the warning. To disable that warning you prepend no- to the warning name.

For example you probably don’t want the c++98 compatibility warnings. At the end of those warnings it shows the flag -Wc++98-compat and to disable them you pass -Wno-c++98-compat.

SSH reverse SOCKs tunnel

May 3rd, 2019 No comments

To open reverse SSH SOCKS5 forwarding:

>ssh -l RemoteUser -R 8765:127.0.0.1:22 -v RemoteHost \
 ssh -v -D 1080 -p 8765 127.0.0.1 -N -l LocalUser

Categories: FreeBSD, Linux, Системы Tags: , ,