Skip to content

Instantly share code, notes, and snippets.

View trzecieu's full-sized avatar

Piotr Paczkowski (trzeci.eu) trzecieu

View GitHub Profile
package pl.asria.tools.data.secure {
public class sInt
{
protected var _lifespan:int;
protected var _counter:int;
protected var _value:int;
protected var _lock:int;
public function sIntR(val:int = 0, lifespan:int = 16)
{
@echo off
chdir D:\APP\CYGWIN_SETUP
IF NOT EXIST CYGWIN_SETUP (
mkdir CYGWIN_SETUP
)
chdir D:\APP\CYGWIN_SETUP
wget http://cygwin.com/setup-x86.exe -O setup-x86.exe
setup-x86 --arch x86 --quiet-mode --no-admin --no-startmenu --no-desktop --no-shortcuts --root C:\cygwin --site http://cygwin.mirror.constant.com --packages libuuid1,libuuid-devel,make,gettext-devel,libgettextpo-devel,libgettextpo0,libintl-devel,libintl3,libintl8,gettext
@trzecieu
trzecieu / fetch
Created October 18, 2015 19:20
Fetch devopreaction.tumbrl.com
#!/usr/bin/env python
api_key = "" #API KEY
blog = "devopsreactions.tumblr.com"
url_info = "https://api.tumblr.com/v2/blog/{blog}/info?api_key={api_key}"
url_posts = "https://api.tumblr.com/v2/blog/{blog}/posts/text?api_key={api_key}&offset={offset}"
def get_info():
return url_info.format(api_key=api_key, blog=blog)
@echo off
set CPath=$E[92m
set CPathAdmin=$E[93m
set CInd=$E[90m
set CReset=$E[90m
rem Simple "ver" prints empty line before Windows version
rem Use this construction to print just a version info
cmd /d /c ver | "%windir%\system32\find.exe" "Windows"
@rem File is based on CmdInit.cmd from ConEmu folder
@rem To make it work, it's required to change tasks in XML
@echo off
:: I would like to achieve efect like:
:: User@PC PATH
:: Where @ becomes # if admin
rem Simple "ver" prints empty line before Windows version
@ECHO OFF
SET "LINUXTMP=$(echo '%TMP:\=\\%' | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|')"
echo LINUXTMP = "%LINUXTMP%"
ECHO --- PulseAudio...
C:\Windows\System32\bash.exe -xc "wget -cO '%LINUXTMP%/pulseaudio.zip' 'http://bosmans.ch/pulseaudio/pulseaudio-1.1.zip'"
ECHO --- Extracting PulseAudio
md "%TMP%\pulseaudio"
@trzecieu
trzecieu / install_wsl.bat
Last active July 5, 2024 14:28
WSL Scripts
@echo off
echo - This scripts automates process of installing Windows Subsystem for Linux (WSL)
REM Due some limitations, this script has to be can't be executed under PowerShell
Get-ChildItem >nul 2>&1
if %errorLevel% == 0 (
echo # Swich to CMD
cmd /c start "" %0
exit 0
)
@trzecieu
trzecieu / reset_all_windows10_store_apps.ps1
Last active March 13, 2017 19:20
reset_all_windows10_store_apps
# For when for some reason these apps are failing like:
# - unable to open Photos
# - Cannot type right after pressing 'Win' button
# source: https://answers.microsoft.com/en-us/windows/forum/windows_10-win_cortana/cant-type-in-windows-10-search-bar/7dce8411-8671-4d3e-90d1-b9bdc0aa4734
Get-AppXPackage -AllUsers |Where-Object {$_.InstallLocation -like "*SystemApps*"} | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
@trzecieu
trzecieu / install_wsl_creators_update.bat
Last active June 29, 2019 11:39
Automates process of installation and configuration of WSL
@echo off
echo - This scripts automates process of installing Windows Subsystem for Linux (WSL)
REM Due some limitations, this script has to be can't be executed under PowerShell
Get-ChildItem >nul 2>&1
if %errorLevel% == 0 (
echo # Swich to CMD
cmd /c start "" %0
exit 0
)
@trzecieu
trzecieu / code-url-handler.desktop
Created December 3, 2018 09:29
VS code *.desktop files
#/usr/share/applications/code-url-handler.desktop
[Desktop Entry]
Name=Visual Studio Code - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --open-url %U
Icon=code
Type=Application
NoDisplay=true
StartupNotify=true