Skip to content

Instantly share code, notes, and snippets.

View xsnpdngv's full-sized avatar

Tamás Dezső xsnpdngv

View GitHub Profile
@xsnpdngv
xsnpdngv / exportEachPageToSvg.vba
Created February 17, 2017 09:43
Visio macro to export each page to svg
Sub exportSvg()
Dim formatExtension As String
formatExtension = ".svg"
' initializations
folder = ThisDocument.Path
Set doc = Visio.ActiveDocument
folder = doc.Path
@xsnpdngv
xsnpdngv / Free O'Reilly Books.md
Created June 20, 2017 22:39 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@xsnpdngv
xsnpdngv / batteryFullNotif.vbs
Last active October 28, 2021 03:18
battery full notification VB script
' Battery Full Notification VBS - checking in each 5 min
' To start automatically on logon, put into the directory that opens on:
' Win+R: Open: [shell:startup] -> [OK]
' (C:\Users\YOU\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)
set oLocator = CreateObject("WbemScripting.SWbemLocator")
set oServices = oLocator.ConnectServer(".","root\wmi")
set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
for each oResult in oResults
iFull = oResult.FullChargedCapacity
@xsnpdngv
xsnpdngv / keybindings.json
Created December 2, 2020 15:52
VSCode keybinding to switch between terminals
// Place your key bindings in this file to override the defaults
[
{
"key" : "shift+right", //"ctrl+down" is not working
"command": "workbench.action.terminal.focusNext",
"when" : "terminalFocus",
},
{
"key" : "shift+left", //"ctrl+up" is not working
"command": "workbench.action.terminal.focusPrevious",
@xsnpdngv
xsnpdngv / com.ubuntu.enable-hibernate.pkla
Created May 1, 2017 00:04
Enable hibernate option in Ubuntu: Create or edit under: /etc/polkit-1/localauthority/50-local.d/
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
@xsnpdngv
xsnpdngv / cpufreq-sh
Last active September 8, 2020 08:49
Set CPU governor to powersave on Ubuntu
#!/bin/sh
sudo apt-get install cpufrequtils
echo 'GOVERNOR="powersave"' | sudo tee /etc/defaults/cpufrequtils
sudo /etc/init.d/cpufrequtils restart
cpufreq-info
@xsnpdngv
xsnpdngv / CMakeLists.txt
Last active February 29, 2020 20:01
Useful C++ compile flags
add_compile_options(-Wall
-Wextra
-pedantic
-Werror
-Wunitialized / -Wmaybe-uninitialized
-Wnon-virtual-dtor
-Weffc++
)
@xsnpdngv
xsnpdngv / off_sh
Created July 20, 2019 12:45
Turn off screen on ubuntu
#!/bin/bash
xset dpms force off
@xsnpdngv
xsnpdngv / smb.conf
Last active November 18, 2017 17:22
enable linux to access asus router's samba share
##########################
### ON THE CLIENT SIDE ###
##########################
# to be put into the global section of the file /etc/samba/smb.conf
# (if there is no such: sudo apt-get install smbclient)
client use spnego = no
# To connect other (normal) Samba servers:
client use spnego = yes
client schannel = auto
@xsnpdngv
xsnpdngv / ftpsh
Last active November 8, 2017 14:01
FTP bash script
#!/bin/bash
# ============================================================================
# @file ftpsh
# @brief Script to execute command line arguments as FTP command
# @author Tamas Dezso <dezso.t.tamas@gmail.com>
# @date November 8, 2017
# ============================================================================
if [ $# -lt 1 ]
then