C++ Linking Chilkat Linux

Create project folder, for example ~cktest: cd cktest Download C++ GCC Chilkat Library: wget tar xfz ./*.gz Move include and lib folder to cktest Create your .cpp program, for example my.cpp #include <CkJsonObject.h> #include <iostream> int ChilkatSample() { CkJsonObject json;      bool success; int index = -1; success = json.AddStringAt(-1,"Title","Pan's Labyrinth"); success = json.AddStringAt(-1,"Director","Guillermo del Toro"); success = json.AddStringAt(-1,"Original_Title","El laberinto del fauno"); success = json.AddIntAt(-1,"Year_Released",2006); json.put_EmitCompact(false); std::cout << json.emit() << "\r\n"; exit(EXIT_SUCCESS); } static int s = ChilkatSample(); int main() { std::cout << "Inside main() - dummy things"; } To compile: g++ my.cpp -I./include -L./lib -lc

Fail2ban cheat codes

Show all rules: fail2ban-client status Show banned IP's specific rule: fail2ban-client status sshd  Unban some IP: fail2ban-client set yourjailname unbanip youripaddress  

BOOST C++ Compile VS2019

1. Download and unzip boost from 2. Lets say, boost unzipped to c:\downloads 3. Run "x64 Native Tools Command Prompt for VS 2019" (its important to run this one instead of power shell or normal cmd) 4. cd c:\downloads 5. .\bootstrap 6. b2 --prefix=c:\boost_libs --toolset=msvc-14.2 --address-model=64 --architecture=x86 --runtime-link=static,shared --link=static threading=multi install 7. boost will be installed in c:\boost_libs 8. In VS2019 --> Solution Explorer --> "Project" --> Properties --> C++ --> Additional Include Directories --> Add c:\boost_libs\include 9. In VS2019 --> Solution Explorer --> "Project" --> Properties --> Linker --> General --> Additional Library Directories --> Add c:\boost_libs\lib Since VS2010 there is no global directories, you need to specify per project options.

Git goodies

  Save password to git, need to enter password once after:   git config --global credential.helper store Set vim as default git editor: git config --global core.editor "vim"     See git config: git config -l

Ubuntu VM change resolution

From within the Ubuntu virtual machine, open Terminal sudo vim /etc/default/grub Find GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" Append that to the end of the line "video=hyperv_fb:[specify resolution, e.g. 1024x768]" For example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1024x768" Save changes and exit Run the following command: sudo update-grub Restart the VM

Wget single file from github

When you view a file it has a link to the "raw" version. Click copy URL, in terminal wget (paste):  

Mapserver install on Ubuntu 18.04 with Naviserver:

Mapserver install on Ubuntu 18.04 with Naviserver: I assume you have already installed Naviserver, PostgreSQL and PostGIS. Update apt-get apt-get update Install dependencies: apt-get install libprotobuf-c-dev apt-get install protobuf-c-compiler apt-get install libjpeg-dev apt-get install libfreetype6 apt-get install libfreetype6-dev apt-get install libproj-dev apt-get install libfribidi-dev apt-get install libharfbuzz-dev apt-get install libcairo2-dev apt-get install libgeos-dev apt-get install libgdal-dev apt-get install libpixman-1-dev apt-get install libfcgi-dev Download Mapserver from Extract tar to some directory, create build directory and run from build cmake -DCMAKE_INSTALL_PREFIX=/opt/mapserver --DWITH_WITH_KML=ON -DWITH_CLIENT_WFS=ON -DWITH_CLIENT_WMS=ON -DWITH_SOS=ON --DWITH_WITH_XMLMAPFILE=ON ../ It will build and install Mapserver into /opt/mapserver