Skip to content

Instantly share code, notes, and snippets.

View xorenio's full-sized avatar
🚀
Minimal code, Maximum effort

John J xorenio

🚀
Minimal code, Maximum effort
View GitHub Profile
@xorenio
xorenio / auth.php
Last active June 19, 2024 09:52
bad ideas
<?php
/* SWITCH USER ACCOUNTS */
public function getChangeAccount($id)
{
if(Session::has('old_id'))
if($id != Session::get('old_id'))
{
Session::forget('old_id');
if(Session::has('old_email'))
Session::forget('old_email');
@xorenio
xorenio / redis_queue.sh
Last active March 28, 2024 22:43
bash redis queue
# START - QUEUE
# Function: _queue_command
# Description: Adds a command to the Redis command queue with an optional schedule.
# Parameters:
# $1: The command to be added to the queue. Example "echo Hello, World!"
# $2: (Optional) The schedule for the command ("2023-06-30 12:00:00"). Default is "now".
# Returns: None
_queue_command() {
@xorenio
xorenio / terminal_calendar.sh
Created May 9, 2023 12:50
Simple bash terminal calendar
#!/bin/bash
# Get current year and month
year=$(date +%Y)
month=$(date +%m)
# Print month and year
echo "$(date +%B\ %Y)"
# Print the days of the week
@xorenio
xorenio / upload_folder.py
Created February 16, 2023 16:15
Uploading files from windows
// Prompt for openAI's ChatGPT: Make python script for windows to upload given folder to ssh
import os
import paramiko
local_path = r'C:\path\to\folder'
remote_path = '/path/on/remote/server'
hostname = 'remote.server.com'
username = 'your_username'
password = 'your_password'
@xorenio
xorenio / readme.md
Last active September 27, 2022 06:52
Twisted Team Fortress 2

This is a collection of notes, mods and servers stuff for Team Fortress 2

Team Fortess 2 Client-Side

Useful notes for making the game nicer to play.

How to Install Mods

@xorenio
xorenio / skyrim-mod-details.md
Last active July 18, 2022 12:23
A how to Skyrim Multiplayer Together Reborn for players

Skyrim Together Reborn (how to)

Requirements

Server Details

&gt; ping abc.xoren.io for server ip

@xorenio
xorenio / create_ldap_homes.sh
Created January 12, 2019 20:53
create LDAP homes
#!/bin/bash
##HOMES=$(getent passwd)
HOMES=$(sudo getent passwd | awk -F ":" '$7 == "/bin/bash" && $3 >= 2000 {print $1":"$6}')
for i in ${HOMES}; do
ARR=(${i//:/ })
NAME=${ARR[0]}
HOME=${ARR[1]}
@xorenio
xorenio / switch.sh
Created September 10, 2018 09:53
cli php switch
#!/bin/bash
echo""
read -p "Changing php Which version? #1:5.6 | #2:7.0 | #3:7.1 | #4:7.2 ?" -n 1 -r && echo ""
if [[ $REPLY =~ ^[1]$ ]]; then
update-alternatives --set php /usr/bin/php5.6
echo 'Now your cli env is 5.6'
elif [[ $REPLY =~ ^[2]$ ]]; then
update-alternatives --set php /usr/bin/php7.0
echo 'Now your cli env is 7.0'
@xorenio
xorenio / to_clipboard.bat
Created May 11, 2018 08:09
Windows bat: echo to clipboard
@echo off
(
echo hello
) | clip
@xorenio
xorenio / im_rebooting_the_vm_script.sh
Last active January 31, 2018 12:54
Debian or Ubuntu update or reboot
#!/bin/bash
UPDATES=$(LANG=C apt-get upgrade -s |grep -P '^\d+ upgraded'|cut -d" " -f1);
if [ $UPDATES -lt 0 ]; then
reboot
else
echo "yay you finally updated";
fi