This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [ $(df -P /dev/sda1 | awk '{ gsub("%",""); capacity = $5 }; END { print capacity }') -gt 95 ] | |
| then | |
| find /var/www/html/ -type f | sort -n | head -50 | xargs rm | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| COUNT=$(ps ax | grep <command> | wc -l) | |
| if [ $COUNT -gt 1 ]; then | |
| exit 0 | |
| fi | |
| run <command> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| COUNT=$(ps ax | grep avconv | wc -l) | |
| if [ $COUNT -gt 1 ]; then | |
| echo "running already" | |
| exit 0 | |
| fi | |
| i=1 | |
| while [ $i -le 3 ]; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # keybind: { "keys": ["ctrl+d"], "command": "exec", "args": { "cmd": ["/home/luan/scripts/sublime-refresh-browser.sh"]} } | |
| xdotool search --onlyvisible --class "chromium" windowfocus key ctrl+r | |
| xdotool search --onlyvisible --class "sublime-text" windowfocus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| printf "\nBlowing up your hard drive... please wait.\n" | |
| printf "\nWriting:\n" | |
| dd if=/dev/zero of=testfile bs=1024k count=512 | |
| printf "\nReading:\n" | |
| dd if=testfile of=/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # change the 'filename.ext' part and run | |
| git filter-branch -f --index-filter "git rm -r --cached --ignore-unmatch filename.ext" --tag-name-filter cat -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Teamspeak Service | |
| After=network.target | |
| [Service] | |
| WorkingDirectory=/opt/teamspeak3-server_linux_amd64 | |
| ExecStart=/opt/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh | |
| ExecStop=/opt/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop | |
| ExecReload=/opt/teamspeak3-server_linux_amd64/ts3server_startscript.sh restart | |
| PIDFile=/opt/teamspeak3-server_linux_amd64/ts3server.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $script = <<SCRIPT | |
| apt-get update | |
| apt-get install sudo | |
| gpasswd -a vagrant sudo | |
| echo "mysql-server mysql-server/root_password password password" | debconf-set-selections | |
| echo "mysql-server mysql-server/root_password_again password password" | debconf-set-selections | |
| apt-get -y install mysql-server | |
| sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>VueJS simplest todo ever</title> | |
| <script src="https://unpkg.com/vue"></script> | |
| </head> | |
| <body> | |
| <div id="app"> | |
| <ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function log_exec() | |
| { | |
| $stack = json_encode(debug_backtrace(), JSON_PRETTY_PRINT) . "\n\n"; | |
| file_put_contents('/tmp/log.txt', $stack, FILE_APPEND); | |
| } | |
| function middle_func() | |
| { |