Skip to content

Instantly share code, notes, and snippets.

View Canx's full-sized avatar

Ruben Cancho Canx

View GitHub Profile
@Canx
Canx / nslcd.conf
Created December 21, 2021 11:28
Lliurex servidor esclavo nslcd.conf
# /etc/nslcd.conf
# nslcd configuration file. See nslcd.conf(5)
# for details.
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
uri ldap://localhost
@Canx
Canx / ldap.conf
Created December 21, 2021 10:33
Lliurex slave LDAP config
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
#BASE dc=example,dc=com
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
@Canx
Canx / ldap.conf
Created December 21, 2021 10:32
Configuración LDAP clickcontrol
###DEBCONF###
#
# LDAP Defaults
#
TLS_CACERT never
base dc=centro,dc=com
uri ldap://fsserver
@Canx
Canx / get-display
Created April 29, 2021 07:53
Parche para que funcione el control de epoptes en el login en Lliurex19. Sustituir get-display en /usr/share/epoptes-client en clientes. Ver líneas 52-55.
#!/bin/sh
###########################################################################
# Output DISPLAY and XAUTHORITY for the current user's X screen.
# A root user can then use those to access the user's display.
# Usage: export $(get-display)
#
# Copyright (C) 2012 Alkis Georgopoulos <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@Canx
Canx / editar.sh
Created September 4, 2020 07:32
procesar fotos de la orla
#!/bin/bash
for image in fotos/*.jpg
do
echo "Procesando $image..."
filename=`basename "$image" | cut -d'.' -f1`
new_image="./orla/$filename.jpg"
convert "$image" -resize 500x500 -gravity center -background white -extent 500x500 "$new_image"
convert "$new_image" -background White label:"$filename" +swap -gravity Center -append "$new_image"
done
echo "********************************************************";
echo "Moodle Upgrade Started...";
echo "********************************************************";
echo "";
echo "********************************************************";
echo "Activating Moodle Maintenance Mode...";
echo "********************************************************";
echo "";
sudo php /var/www/moodle/admin/cli/maintenance.php --enable
echo "********************************************************";
#!/bin/bash
# TODO: comprobar que xprintidle está instalado.
USER=""
DISPLAY=""
check_xprintidle() {
if [ $(dpkg-query -W -f='${Status}' xprintidle 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
apt-get install xprintidle;
sudo xhost local:test
package asale;
import java.text.ParseException;
import java.text.RuleBasedCollator;
import java.util.Scanner;
public class asale {
public static void main(String[] args) throws ParseException {
Scanner in = new Scanner(System.in);
String primera;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Empezamos {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
boolean fin = false;
boolean primero;