Skip to content

Instantly share code, notes, and snippets.

@MrCitron
MrCitron / copy_cd.ps1
Created April 7, 2020 16:50
Powershell script to ease the copy of many CD contents to harddrive
# run with & powershell.exe -executionpolicy bypass -file .\copy_cd.ps1
Add-Type -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace CDROM
{
public class Commands
@MrCitron
MrCitron / lacie.sh
Created October 31, 2018 16:15
Make lacie rugged working throught usb 3 on ubuntu
deviceId=$(lsusb | grep LaCie | cut -d ' ' -f 6)
echo options usb-storage quirks=${deviceId}:u | sudo tee /etc/modprobe.d/blacklist_uas_357d.conf
sudo update-initramfs -u
echo unplug the disk and reboot
@MrCitron
MrCitron / gita
Created October 5, 2017 20:06
Git command on all subfolders (gita)
#!/bin/bash
red="\033[0;31m"
NC="\033[0m" # No Color
for i in ./*
do
if [ -d "$i" ]
then
if [ -d "$i/.git" ]
@MrCitron
MrCitron / graphQLToJSON.js
Created May 23, 2017 09:48
GraphQL to JSON in pure JS
function graphQLToJSON(query) {
return "{\"query\": \"query" +
query.replace(/\n/g, " ").replace(/"/g, "\\\"") +
"\"}";
}
@MrCitron
MrCitron / msr.sh
Last active November 17, 2015 19:41
Multiple search and replace in bash
#!/bin/bash
# $1 : original file
# $2 : destination file
# $3 : patterns file
if [ ! $# -eq 3 ];
then
echo Usage : $0 original destination patterns
exit 1
fi