Skip to content

Instantly share code, notes, and snippets.

View ravage's full-sized avatar

Rui Miguel ravage

  • Portugal
  • 05:31 (UTC +01:00)
View GitHub Profile

Instalação PHP & Composer

  • Para Windows descarregar a última versão do PHP (http://windows.php.net/download/) e descompactar para c:\php
  • Descompactar o php-*.zip para c:\php
  • Renomear c:\php\php.ini-development para c:\php\php.ini (fazer overwrite do antigo)
  • Install composer https://getcomposer.org/
  • Abrir uma consola e correr o comando php -S localhost:3000 ou php -S localhost:8080 para ativar o servidor PHP integrado

Instalação Laravel

require "./guronsan/*"
require "json"
require "http"
module Guronsan
module Command
extend self
def run(command, args = nil)
io = String::Builder.new
#!/bin/bash
echo "Running /etc/rc.local" >> /var/log/messages
control_file=/etc/.rc.local.done
if [ -f $control_file ]; then exit 0; fi
# Install Oracle JVM 8
apt-get -y install software-properties-common

Keybase proof

I hereby claim:

  • I am ravage on github.
  • I am ruiribeiro (https://keybase.io/ruiribeiro) on keybase.
  • I have a public key ASAzNKxqsAGgOrQOCokdM3-0L0pAhyBbAwJTaf0L8BY00Qo

To claim this, I am signing this object:

static void Main(string[] args)
{
Run().GetAwaiter().GetResult();
}
static async Task Run()
{
TcpClient client = new TcpClient("127.0.0.1", 8080);
NetworkStream stream = client.GetStream();
@ravage
ravage / asuswrt-merlin-cloudflare-ddns-update.md
Last active April 13, 2020 15:38
asuswrt merlin cloudflare ddns update
#!/bin/sh
# /jffs/scripts/ddns-start
zone=<zone_id>
record=<record_id>
token=<bearer_token>
fqdn=<fqdn>
myip=$(/usr/sbin/nvram get wan0_ipaddr)
@ravage
ravage / recover_netboot.sh
Created May 14, 2020 21:51
Hopefully set previous boot order after unattended PXE installation
#!/bin/sh
test -d /sys/firmware/efi && efibootmgr -o $(efibootmgr | grep "BootOrder" | sed -e 's/BootOrder\: 0000,\(.*\)/\1,0000/')
@ravage
ravage / singleton.cs
Last active September 25, 2020 09:35
// Not thread safe
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/sealed
public sealed class Singleton {
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/static
private static Singleton instance = null;
// hide constructor from public interface
private Singleton() {}
public static Singleton Instance {
@ravage
ravage / job_submit.lua
Last active December 27, 2020 22:57
Slurm Job Submission Policies
function slurm_job_submit(job_desc, part_list, submit_uid)
if job_desc.account == nil then
slurm.log_error("User %s did not specify an account.", job_desc.user_id)
slurm.log_user("Please speficy an account with every job submission.")
slurm.log_user("Check available accounts with: 'sacctmgr -P show assoc user=$USER format=account'.")
slurm.log_user("Specify the account with the flags -A or --account.")
return slurm.ESLURM_INVALID_ACCOUNT
elseif string.match(job_desc.work_dir, "^/home/*") then
slurm.log_error("User %s had workdir set to home directory.", job_desc.user_id)
slurm.log_user("Please don't run jobs from your home directory.")
{
"RNCA_report_type": "RNCA_Resource_Usage",
"report_version": "1",
"report_date": "2021-04-09 10:47:00",
"RNCA_resource_id": "...",
"RNCA_proj_ID": "...",
"proj_resource_type": "string (HPC | CLOUD | OTHER)",
"items": [
{
"job_id": "uint",