Skip to content

Instantly share code, notes, and snippets.

Dāvis davispuh

Block or report user

Report or block davispuh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davispuh
davispuh / switch-modules.sh
Last active Nov 23, 2019
Switch NVIDIA/nouveau modules
View switch-modules.sh
#!/bin/sh
unbind_vtconsoles()
{
for ((i = 0; i < 16; i++))
do
if [ -d "/sys/class/vtconsole/vtcon$i" ]; then
if [ `cat /sys/class/vtconsole/vtcon$i/name | grep -c "frame buffer"` -eq 1 ]; then
while [ `cat /sys/class/vtconsole/vtcon$i/bind` -ne 0 ]; do
@davispuh
davispuh / steam_console_params.txt
Last active Nov 14, 2019
Steam client parameters, consoles commands and variables
View steam_console_params.txt
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accountrecovery - Perform account recovery
-all_languages - show longest loc string from any language
-bigpicture - Start in Steam Big Picture mode
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
-community - Set the community URL
-complete_install_via_http - Run installation completion over HTTP by default
@davispuh
davispuh / bitcoind.service
Created Jan 6, 2014
Bitcoin-daemon service file for Systemd
View bitcoind.service
[Unit]
Description=Bitcoin daemon serivce
After=network.target
[Service]
Type=simple
User=bitcoin
ExecStart=/usr/bin/bitcoind
[Install]
@davispuh
davispuh / files.rb
Created Mar 23, 2016
Show Tar archive files
View files.rb
#!/bin/ruby
require 'faraday'
url = 'http://domain/somefile.tar'
conn = Faraday.new
header_response = conn.head(url)
total_size = header_response.env[:response_headers]["content-length"].to_i
@davispuh
davispuh / efifb.patch
Created Mar 22, 2016
Make efifb as a loadable module
View efifb.patch
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 8ea45a5..de3c96e 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -760,7 +760,7 @@ config FB_VESA
read <file:Documentation/fb/vesafb.txt>. If unsure, say Y.
config FB_EFI
- bool "EFI-based Framebuffer Support"
+ tristate "EFI-based Framebuffer Support"
@davispuh
davispuh / test_daylight_savings.patch
Created Jan 26, 2016
Chronic test_daylight_savings
View test_daylight_savings.patch
diff --git a/test/test_daylight_savings.rb b/test/test_daylight_savings.rb
index d6f303f..3dfdc26 100644
--- a/test/test_daylight_savings.rb
+++ b/test/test_daylight_savings.rb
@@ -9,110 +9,91 @@ class TestDaylightSavings < TestCase
def test_begin_past
# ambiguous - resolve to last night
- t = Chronic::RepeaterTime.new('900')
- t.start = @begin_daylight_savings
@davispuh
davispuh / A.cmd
Last active Dec 27, 2015
Crash Windows. Tested to work for XP, Vista, Windows 7
View A.cmd
@echo off
REM This script is dedicated to Public Domain
FOR %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9) DO (
mkdir %%i
copy %~nx0 %%i
cd %%i
start %~nx0
cd ..
)
del %~nx0
View test3.rb
#!/usr/bin/env ruby
#encoding: utf-8
require 'win32/registry'
begin
Win32::Registry::HKEY_CURRENT_USER.open("Software", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg['test2'] = 'åáâäãā'
reg['test3åáâäãā'] = 'åáâäãā'
value = reg['test']
puts value.encoding
View test.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software]
"test"="åáâäãā"
"åáâäãā"="åáâäãā"
View RubyBug
N:\Projects>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
N:\Projects>chcp 775
Active code page: 775
N:\Projects>ruby test2.rb
IBM775
Sistńma nevar atrast norŌdŅto failu.
"Sist\xE7ma nevar atrast nor\xE2d\xEEto failu."
You can’t perform that action at this time.