Skip to content

Instantly share code, notes, and snippets.

View Xarkam's full-sized avatar
🏠
Working from home

Benjamin Nolmans Xarkam

🏠
Working from home
View GitHub Profile
@Xarkam
Xarkam / test.sh
Created November 5, 2013 18:42
Check folder and sub folder to adapt permissions
#!/bin/bash
for file in `find . `
do
permissions=`stat -c %a $file`
if [ $permissions = "660" ]
then
permissions=664
echo "Permission 660 trouvée"
else
permissions=775
#
# apk_gen.ps1
# To execute script run in cmd : %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "./apk_gen.ps1"
# Chargement des assemblies
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
### Function ###
function Get-ScriptDirectory {
<#
@Xarkam
Xarkam / custom_entries.js
Created January 30, 2016 16:54
Toolbar Almighty custom entries for git.
module.exports = [
{
type: 'spacer'
},
{
type: 'button',
tooltip: 'Git Add All',
dependency: 'git-plus',
callback: 'git-plus:add-all',
icon: 'git',
@Xarkam
Xarkam / add_software.sh
Last active November 2, 2020 14:47
Ubuntu after installation
#!/bin/bash
# /!\ Install Nvidia Driver by Software & Updates in Ubuntu Settings /!\
# For JetBrains IDE, add export IBUS_ENABLE_SYNC_MODE=1 to ~/.profile file
sudo add-apt-repository ppa:webupd8team/java
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo add-apt-repository ppa:obsproject/obs-studio
# Hipchat
echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add -
# Google Chrome /!\ appear disabled on Google.com
@Xarkam
Xarkam / firewall.sh
Last active November 29, 2017 19:44
Iptables flush and define
#!/bin/sh
# How to block a scanner on your server for example “w00tw00t.at.ISC.SANS” using $ipt?
# $ipt -I INPUT -p tcp --dport 80 -m string --algo bm --string 'GET /w00tw00t.at.ISC.SANS.' -j DROP
# Check if ran with root permissions
if [ `id -u` -ne 0 ]; then
echo "The script must be run as root! (you can use sudo)"
exit 1
fi
@Xarkam
Xarkam / Update postgresql 9.3 to 9.4 on Linux.txt
Last active July 16, 2019 07:57
Update postgresql 9.3 to 9.4 on Linux
Steps:
1. uninstall Postgres 9.4
2. install 9.3
3. backup the database using pg_dumpall > backup.sql
4. uninstall Postgres 9.3
5. install Postgres 9.4
6. restore the databases using psql -d postgres -f backup.sql
@Xarkam
Xarkam / add_vmware_screen_resolution.sh
Created October 12, 2016 07:13
VMWare Screen Resolution Linux 1920x1080
#!/bin/bash
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080_60.00
xrandr --output Virtual1 --mode 1920x1080_60.00
@Xarkam
Xarkam / Remove safely dev package.txt
Last active July 16, 2019 07:58
Remove safely dev package
apt-get remove --purge $(aptitude -F '%p' search '~i -dev$')
@Xarkam
Xarkam / Putty sessions save.txt
Last active July 16, 2019 07:59
Putty sessions save
regedit /e "%userprofile%desktopputty-sessions.reg" HKEY_CURRENT_USERSoftwareSimonTathamPuTTYSessions
@Xarkam
Xarkam / list_security_update.sh
Created October 12, 2016 07:14
Ubuntu list automatic security updated packages
#!/bin/bash
cat /var/run/reboot-required.pkgs
xargs aptitude changelog < /var/run/reboot-required.pkgs | grep urgency=high