Skip to content

Instantly share code, notes, and snippets.

View BoQsc's full-sized avatar
💭
I may be slow to respond.

Feldwor BoQsc

💭
I may be slow to respond.
  • Public Domain
  • Baltic States
  • 08:35 (UTC +03:00)
View GitHub Profile
@BoQsc
BoQsc / ttyswitch.bash
Last active November 17, 2019 12:28
Switching to TTY via command line
sudo chvt 3
#More info
# man chvt
#https://www.linuxquestions.org/questions/linux-software-2/is-there-a-way-to-switch-to-a-tty-with-a-command-135429/
#How to start and switch to a New Gnome Shell with XDG_SESSION_TYPE="x11"?
@BoQsc
BoQsc / gist:310a9c150a90994b006eb509f6b693bd
Created December 1, 2019 16:27
Rare linux commands to research
`mtr`
`apt-file`
@BoQsc
BoQsc / download-latest-dmd.cmd
Created December 17, 2019 16:58
A simple batch file to download latest D language compiler's setup and launch it in a single click
@ECHO OFF
:Download-version-number-file-from-dlang
:: Downloads LATEST file from dlang, via bitsadmin - official command line download utility included since Windows 7
:: LATEST file is a plain text file that contains a single line of text: a number of latest version of DMD.
bitsadmin /Transfer "%random%" "http://downloads.dlang.org/releases/LATEST" "%cd%/LATEST"
IF NOT ERRORLEVEL 0 (
TITLE BITSADMIN have an error, retrying to download LATEST file
TIMEOUT "2"
CLS
@BoQsc
BoQsc / reloadGnome.md
Last active December 14, 2024 16:42
Reloading Gnome Desktop Environment via command line

dbus-run-session -- gnome-shell --nested --wayland

busctl --user call \ org.gnome.Shell \ /org/gnome/Shell \ org.gnome.Shell.Extensions ReloadExtension \ s "$name"

@BoQsc
BoQsc / screenturnoff.cmd.md
Last active December 24, 2019 12:30
Turn on screensaver, turn off screen in Linux Wayland Gnome
@BoQsc
BoQsc / LinuxDefaultBrowser.md
Created December 24, 2019 12:33
Setting default browser for Linux Desktop environment
Get the desktop file name of the current default web browser

                   xdg-settings get default-web-browser

       Check whether the default web browser is firefox.desktop, which can be
       false even if "get default-web-browser" says that is the current value
       (if only some of the underlying settings actually reflect that value)

 xdg-settings check default-web-browser firefox.desktop
@BoQsc
BoQsc / slowdowncpulinux.md
Last active December 26, 2019 11:04
Slow down Intel CPU

Disabling Turbo Boost intel_pstate

# https://wiki.archlinux.org/index.php/CPU_frequency_scaling
cat /sys/devices/system/cpu/intel_pstate/no_turbo
cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
@BoQsc
BoQsc / install-ubuntu-gnome.bash
Created December 29, 2019 10:48
Installs Ubuntu Gnome on Ubuntu
# Installs Gnome with extra components but without Ubuntu extensions
# sudo apt-get install gnome-shell
# Installs Gnome without extra components, adds Vanilla Gnome selection, shell theme is still selected
# sudo apt-get install gnome
# Correct way to install ubuntu gnome
sudo apt-get install ubuntu-gnome-desktop
@BoQsc
BoQsc / example.d
Last active January 8, 2020 15:02
This script is used in Apache CGI, Should be placed in /usr/lib/cgi-bin | The error logs are logged in /var/log/apache2/error.log | To acces the webpage http://localhost/cgi-bin/example.d
#!/usr/bin/env -vS dub run --single --temp-build example.d
/+ dub.sdl:
name "WebApplication"
dependency "arsd-official:dom" version="4.0.2"
+/
import std.stdio;
import arsd.dom;
void main()
{
writeln(`Content-type: text/html`);