Skip to main content

Posts

sanitize on in CMakeLists.txt

1. CMakeLists.txt set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") add_compile_options(-fsanitize=address) If a subdir is set with add_subdirectory and a module that does not support sanitize is imported from the path and needs to be removed, add -fno-sanitize=address to add_compile_options in CMakeLists.txt of the subdir to remove it. Basically, if you enable sanitize, sanitize will adjust ulimit's core to 0, so core will not occur. You can do this by putting the following part as an environment variable. (Below is the part you put in systemd's service) 2. service file in systemd [Service] LimitCORE=infinity Environment="ASAN_OPTIONS=handle_segv=0:handle_abort=1:abort_on_error=1:disable_coredump=0"
Recent posts

e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang

 make a file: /usr/local/etc/ethtool.sh (eno1 is your mgmt i/f, vmbr0 is your bridge i/f.) #!/bin/bash ethtool -K eno1 gso off gro on tso off tx on rx on rxvlan on txvlan on sg on && ethtool -K vmbr0 gso off gro on tso off tx on rx on rxvlan on txvlan on sg on ethtool -G eno1 rx 4096 if you want to activate on reboot. /etc/systemd/system/ethtool.service [Unit] Description=ethtool script [Service] WorkingDirectory=/usr/local/etc/ ExecStart=/usr/local/etc/ethtool.sh [Install] WantedBy=multi-user.target then systemctl enable ethtool.service && systemctl start ethtool.service refs: https://forum.proxmox.com/threads/e1000-driver-hang.58284/page-8#post-390709

Set up VNC login without console login in Ubuntu Gnome environment

 It is said that GNOME does not support VNC connection without logging in by default. So you have to do the following annoying task. 1) gnome-remote-desktop settings Open "Settings" in gnome-remote-desktop, select "Sharing", Find "Remote Desktop" or "Screen Sharing" and disable it.  2) Install x11vnc sudo apt update sudo apt install x11vnc 3) Set x11vnc password x11vnc -storepasswd 4) Set auto-start at boot (create x11vnc.service file) sudo nano /etc/systemd/system/x11vnc.service Contents

Setting ubuntu grub timeout when using efi

 # 1) Edit grub with vi sudo vi /etc/default/grub # 2) Add or modify the following part GRUB_RECORDFAIL_TIMEOUT="5" # 3) Update sudo update-grub The reason is If you look at "/etc/grub.d/00_header" if [ \$grub_platform = efi ]; then set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30} if [ x\$feature_timeout_style = xy ] ; then set timeout_style=menu fi fi Because it's like this.

[WordPress] Change https redirect in DB.

If you make an https redirect without thinking about SSL configuration: Check DB SELECT * from wp_options where option_name IN ('siteurl', 'home'); Update UPDATE wp_options SET option_value = REPLACE(option_value, 'https://your_domain', 'http://your_domain') WHERE option_name IN ('siteurl', 'home');

Setup pyodbc for connecting mssql (with freeTDS)

@Windows 1. pip install pyodbc 2.  Install Windows ODBC driver:  https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-2016 @Linux (Ubuntu-base) 1. freeTDS install using apt apt-get install freetds-dev freetds-bin apt-get install tdsodbc Explanation tdsodbc => /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so freetds-dev freetds-bin => /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so and etc files 2.  edit or add in /etc/odbcinst.ini [FreeTDS] Description = FreeTDS ODBC Driver Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so FileUsage = 1 CPTimeout = CPReuse = Example code: import pyodbc connection_string = ( 'DRIVER={FreeTDS};' 'SERVER=1.2.3.4;' 'PORT=1433;' 'DATABASE=mydbname;' 'UID=myuser;' 'PWD=password;' 'TDS_Version=7.3;' # 'Encrypt=no;TrustServerCertificate=yes;Trusted_Connection=no;' ) ...