Skip to content

Instantly share code, notes, and snippets.

View naxIO's full-sized avatar
🎯
Focusing

Chris naxIO

🎯
Focusing
  • Home
  • 07:54 (UTC +02:00)
View GitHub Profile
@naxIO
naxIO / systemfix.bat
Created July 20, 2024 09:37
This Windows 11 script checks and repairs system files without causing data loss. It performs a system file check, disk check, file system repair, Windows image repair, and initiates a Windows update. The system will restart after the script completes. Ensure all open files are saved before running the script.
@echo off
:: BatchGotAdmin
:CheckPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotAdmin ) else ( goto getAdmin )
:getAdmin
echo This script requires administrator privileges. Please confirm the UAC prompt.
powershell -Command "Start-Process '%~f0' -Verb runAs"
exit /b
@naxIO
naxIO / selenium-webdriver-cheatsheet.md
Created July 12, 2019 16:05 — forked from shoesCodeFor/selenium-webdriver-cheatsheet.md
Ruby Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
@naxIO
naxIO / csvtojson.rb
Created April 12, 2017 21:56
CSV to JSON (Ruby)
#!/usr/bin/env ruby
require 'csv'
require 'json'
if ARGV.size != 2
puts 'Usage: csv_to_json input_file.csv output_file.json'
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects'
exit(1)
end
@naxIO
naxIO / wp.sh
Created February 9, 2017 13:45 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@naxIO
naxIO / F8 HACK
Created March 18, 2014 18:12
F8 HACK
<!--
......................................................................................
......................................................................................
......................................................................................
................................. .................................
................................. o--o o-o .................................
................................. | | | .................................
................................. O-o o-o .................................
................................. | | | .................................
................................. o o-o .................................
@naxIO
naxIO / gist:5885776
Last active December 19, 2015 02:49
batman forever
batman = true
while batman
puts "forever"
end
@naxIO
naxIO / mysql dump database script
Created June 19, 2013 11:36
Simple mysql dump shell script, that uses the actual date for the file. Works with crontab! (Date escaped). Note that there is no space between the -p and the password.
#!/bin/bash
NOW=`/bin/date +"%m%d%Y-%H%M%S"`
if [[ "$?" != "0" ]]; then
NOW="UNKNOWN_DATE"
fi
mysqldump -h hostname -u username -pPassword databasename > /opt/databasebackup/$NOW.sql
if [[ "$?" != "0" ]]; then
echo "$0: backup failed with error code $?"
fi