View create_xorg_for_intel.sh
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
# Create the Xorg.conf template file for intel integrated GPU | |
cat <<EOF | sudo tee /usr/share/X11/xorg.conf.d/20-intel.conf &>/dev/null | |
Section "Device" | |
Identifier "intelgpu0" | |
Option "NoDDC" "true" | |
Option "IgnoreEDID" "true" | |
Driver "intel" | |
EndSection | |
EOF |
View disable_auto_updater.sh
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 bash | |
# Script to disable auto-updater on Ubuntu 16.04 | |
# Disable the automatic package updates | |
echo "Disabling automatic package updates and upgrades" | |
sudo sed -i 's/"1"/"0"/g' /etc/apt/apt.conf.d/10periodic /etc/apt/apt.conf.d/20auto-upgrades | |
# Stop and disable apt updater/upgrade timers/services | |
sudo systemctl disable --now apt-daily.timer |
View qdebug_without_spaces.cpp
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 <QDebug> | |
// Output: Log with spaces Logwithoutspaces Again Logging with spaces | |
int main(int argc, char *argv[]) | |
{ | |
auto log = qDebug(); | |
log << "Log" << "with" << "spaces"; | |
log.nospace(); | |
log << "Log" << "without" << "spaces"; |
View nested_qmap.cpp
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 <QMap> | |
#include <QString> | |
#include <QDebug> | |
#include <array> | |
int main(int argc, char *argv[]) | |
{ | |
enum Gnss { Phoenix, Serell }; | |
enum ImuType { VH301, VD231, Seldov }; |
View nested_qmap.cpp
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 <QMap> | |
#include <QString> | |
#include <QDebug> | |
int main(int argc, char *argv[]) | |
{ | |
enum VehicleManufacturer { Toyota, Holden }; | |
enum VehicleType { HatchBack, Coupe, Sedan }; |
View enable_vnc_ubuntu.sh
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 bash | |
# Immediately exit upon any failures, or undefined variable usage | |
set -ue | |
# Enable Ubuntu included VNC server | |
echo "Enabling VNC server" | |
export DISPLAY=:0 | |
gsettings set org.gnome.Vino enabled true | |
gsettings set org.gnome.Vino prompt-enabled false |
View qt_msvc_dev_console_win32.bat
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
:: Call this batch file with source directory as command line argument. | |
@echo off | |
if ["%~1"]==[""] ( | |
goto end | |
) | |
if exist %~s1 ( | |
if exist %~s1\NUL ( | |
set dir_set=1 | |
cd %~1 | |
) |
View get_qt_creator_nightly_build.sh
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
URL="https://download.qt.io/snapshots/qtcreator/" | |
main_ver=$(wget -qO- ${URL} | sed 's/</\'$'\n''</g' | sed -ne '/<table>$/,$ p' | grep -m1 -oP 'href="\K\d+\.\d+\.?\d*') | |
URL=${URL}${main_ver}/ | |
sub_ver=$(wget -qO- ${URL} | sed 's/</\'$'\n''</g' | sed -ne '/<table>$/,$ p' | grep -m1 -oP 'href="\K\d+\.\d+\.?\d*') | |
URL=${URL}${sub_ver}/ | |
package=$(wget -qO- ${URL} | sed 's/</\'$'\n''</g' | sed -ne '/<table>$/,$ p' | grep -m1 -oP 'href=".+">\K(.+\.run)') | |
wget -c $URL$package |
View palindrome.c
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
/* | |
* Copyright (C) 2020 Raghavendra Nayak | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any purpose | |
* with or without fee is hereby granted. | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | |
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
View pizza_decorator_design_pattern.cpp
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
/* | |
* (c) 2015 Raghavendra Nayak, All Rights Reserved. | |
* www.openguru.com/ | |
*/ | |
#include <iostream> | |
#include <string> | |
// Pizza is the abstract base for all concrete Pizza implementations | |
class Pizza { |
NewerOlder