Skip to content

Instantly share code, notes, and snippets.

View RokkuCode's full-sized avatar

RokkuCode RokkuCode

View GitHub Profile
@RokkuCode
RokkuCode / rockman_x_legacy_collection_{1,2}.sh
Created December 31, 2021 23:49 — forked from themaxhero/rockman_x_legacy_collection_{1,2}.sh
How to make Rockman X Legacy Collection {1,2} work just like in Windows.
#!/bin/sh
# Instructions
# Before running this:
# - Delete your ~/.local/share/Steam/steamapps/compatdata/$GAME_ID folder.
# - Then set your proton version to 5.0-10 for the game.
# - Run the game and close after it starts.
# - After that, you're good to go.
# If the game is Rockman X Legacy Collection 1, the ID should be 743890
# If the game is Rockman X Legacy Collection 2, the ID should be 743900
# Thanks to https://github.com/PedroHLC for Debbuging this thing and finding out how to solve.
@RokkuCode
RokkuCode / .clang-format
Created November 7, 2021 02:16 — forked from maddouri/.clang-format
Allman-style clang-format file initially generated using https://zed0.co.uk/clang-format-configurator/
---
BasedOnStyle: Mozilla
AccessModifierOffset: '-4'
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'false'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
@RokkuCode
RokkuCode / .clang-format
Created June 6, 2021 03:16
clang-format for Allman Style
---
BasedOnStyle: Mozilla
AccessModifierOffset: '-4'
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'false'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
@RokkuCode
RokkuCode / build.sh
Created April 15, 2021 14:03 — forked from superboum/LICENCE.txt
Install Debian with Debootstrap + Grub EFI
#!/bin/bash
set -e # Exit on error
DEVICE=$1
[ -z "${DEVICE}" ] && echo "Usage $0 /dev/sdX" && exit 1
udevadm info -n ${DEVICE} -q property
echo "Selected device is ${DEVICE}"
read -p "[Press enter to continue or CTRL+C to stop]"
@RokkuCode
RokkuCode / sessionclean
Created March 18, 2021 01:52
sessionclean script in sury php packages
#!/bin/sh -e
#
# sessionclean - a script to cleanup stale PHP sessions
#
# Copyright 2013-2015 Ondřej Surý <ondrej@sury.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
use Plack::Builder;
use Plack::App::File;
use CGI::Emulate::PSGI;
use CGI::Compile;
my $path_of_otrs = "/path/otrs";
my $cgi_script_index = $path_of_otrs . "/bin/cgi-bin/index.pl";
my $sub_index = CGI::Compile->compile($cgi_script_index);
my $app_index = CGI::Emulate::PSGI->handler($sub_index);
<?php
function get_tls_version($sslversion = null)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://www.howsmyssl.com/a/check");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
if ($sslversion !== null) {
curl_setopt($c, CURLOPT_SSLVERSION, $sslversion);
}
const
ForecastUrlFormat = "http://api.openweathermap.org/data/2.5/forecast/daily?APPID=$1&lang=en&q=$2&cnt=$3"
ResultFormat = """$1:
$2
Temperature: $3 °C
Humidity: $4%
Clouds: $5%
Wind speed: $6 m/s""".unindent
@RokkuCode
RokkuCode / domain_regex
Last active November 24, 2022 13:39
Domain regex
\b((?=[a-z0-9-]{1,63}\.)(xn(-{0,4}))?[a-z0-9]+(-[a-z0-9]+)*\.)+((xn(-{0,4}))?[a-z0-9]+)
Testcases:
xn--dmin-moa0i.example
xn--aaa-pla.example
xn--aaa-qla.example
xn--aaa-rla.example
xn--aaa-sla.example
xn--dj-kia8a.vu.example
xn--efran-2sa.example
@RokkuCode
RokkuCode / Apache Tomcat 8 Start stop script init.d script
Last active January 8, 2016 03:45 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
# Copyright (C) 2016 Holger Schramm
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under