Skip to content

Instantly share code, notes, and snippets.

View highercomve's full-sized avatar
🏠
Working from home for Pantacor 👍

Sergio Marin highercomve

🏠
Working from home for Pantacor 👍
View GitHub Profile
#!/bin/sh
curl -fsSL https://pi.vpetkov.net -o ventz-media-pi
sh ventz-media-pi

Run VM with qemu with your TPM

example of how to use it

./run_vm_with_drive disk1.qcow2 /dev/sda NUMBER_CPU_YOU_WANT /dev/tpm0

Arguments:

  • disk1.qcow2 if the disk doesn't exist will create a new disk
#!/bin/bash
thermal_zones=$(ls /sys/class/thermal/ | grep thermal_zone | tail -n 1 | sed -e 's/thermal_zone//')
cpu_count=$(nproc)
if [ -e $cpu_temp ] ; then
while [ true ] ; do
value=""
if [ -f /sys/class/powercap/intel-rapl/intel-rapl\:0/energy_uj ]; then
power=$(cat /sys/class/powercap/intel-rapl/intel-rapl\:0/energy_uj)
#!/bin/sh
echo $1 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
2019-12-11 19:34:15,132+0000 ERROR [org.ejbca.core.protocol.ws.EjbcaWS] (default task-1) EJBCA WebService error: org.ejbca.core.EjbcaException
at org.ejbca.core.model.era.RaMasterApiSessionBean.createCertificateWS(RaMasterApiSessionBean.java:1928)
at sun.reflect.GeneratedMethodAccessor960.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:90)
at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:101)

PVR install from docker images

Script to install pantahub pvr from source using docker tag (default: latest), the script build the CLI from the source for the current platform and install it on ~/bin/pvr.

How to use it

curl -o- -L https://git.io/fjEI1 | bash
@highercomve
highercomve / fp.helpers.js
Last active May 10, 2019 22:43
Small library for functional helpers.
function filterIterable (filter, iterable) {
const result = [];
const entries = getEntries(iterable);
for (const [key, value] of entries) {
if (filter(value, key)) {
result.push(value);
}
}
return result;
}
@highercomve
highercomve / content.json
Last active May 10, 2024 17:58
highercomve.github.io content managment
{
"name": "Sergio Marin",
"nick_name": "highercomve",
"tagline": "I'm a software engineer focused on web applications",
"location": "Santiago, Chile",
"networks": [
{
"title": "Sergio Marin's Github page",
"url": "https://github.com/highercomve",
"icon": "github"
const compose = (fn, ...funcs) => {
return (...args) => {
return funcs.reduce((acc, func) => func(acc), fn(...args))
}
}
const generate = (fn, dependency = LazyIterable, descriptor) => {
return Object.create(
Object.assign({ [Symbol.iterator]: fn }, dependency),
descriptor
import React, { useState } from 'react'
import ReactDOM from 'react-dom'
function UserForm () {
const [errors, setErrors] = useState({})
const submit = (event) => {
event.preventDefault()
const form = event.target
const isValid = form.checkValidity() // returns true or false