Skip to content

Instantly share code, notes, and snippets.

💭
Why is github turning into a social network

Daniil Gentili danog

💭
Why is github turning into a social network
Block or report user

Report or block danog

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am danog on github.
  • I am danog (https://keybase.io/danog) on keybase.
  • I have a public key whose fingerprint is C0A1 F63D 5208 5C66 570C D56D 2599 0030 8520 B573

To claim this, I am signing this object:

@danog
danog / name.sh
Last active Nov 12, 2017
Just the name
View name.sh
#!/bin/sh
echo "This script prints just the script's name without its full path.
`basename $0`
"
@danog
danog / sudo.sh
Created Apr 14, 2015
Automatic sudo request
View sudo.sh
#!/bin/bash
# Automatic sudo request
if [ $(id -u) -ne 0 ]; then
sudo $0 $* || echo "I am not sudo."
exit $?
fi
echo "I am sudo."
@danog
danog / update.sh
Last active Aug 29, 2015
Update Debian/Ubuntu system
View update.sh
#!/bin/bash
# Debian/Ubuntu updater script
# Created by Daniil Gentili
if [ "$1" = "--help" ]; then
echo "Debian/Ubuntu upgrade script created by Daniil Gentili.
Usage: just type
update.sh
@danog
danog / music.sh
Last active Aug 29, 2015
MP3 Player script
View music.sh
#!/bin/bash
# Script to play mp3 files.
# By Daniil Gentili
if [ "$1" = "--help" ]; then echo "Music player by Daniil Gentili.
Usage: `basename $0` [ Options ] file1 file2 ...
If called with no arguments you will be asked to select the file(s) to play.
Options:
@danog
danog / crontab.sh
Last active Aug 29, 2015
Edit crontab in a script
View crontab.sh
#!/bin/bash
# Script to edit crontab by Daniil Gentili
echo "Editing crontab..."; echo "$(crontab -l)
$*" | crontab - && echo "Crontab edited successfully." || echo "Couldn't edit crontab."
View dropbox_youtube_dl.sh
#!/bin/bash
### Original script by Geoffeg, modified by Roblight and later by me (alias me='alias Danog='Daniil Gentili'')
### How to install this script:
### wget https://gist.githubusercontent.com/danog/f86bf3113e1644b4d5d9/raw/dropbox_youtube_dl.sh -O ~/dropbox_youtube_dl.sh && chmod 755 ~/dropbox_youtube_dl.sh && ~/dropbox_youtube_dl.sh --install
###
### IFTTT Recipe URL: https://ifttt.com/recipes/277403-download-every-youtube-video-you-add-to-your-watch-later-playlist-automatically
if [ "$1" = "--install" ]; then
if [ -f /usr/local/bin/youtube-dl ]; then echo "Youtube-dl already installed."; else echo "Installing youtube-dl..."; sudo curl https://yt-dl.org/downloads/2015.04.03/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+x /usr/local/bin/youtube-dl && echo "YouTube-dl installed successfully." || echo "Couldn't install YouTube-dl."; fi
@danog
danog / dropbox_inst.sh
Last active May 20, 2016
Dropbox headless installation script
View dropbox_inst.sh
#!/bin/bash
# Dropbox installation script by Daniil Gentili.
if [ -f ~/.dropbox-dist/dropboxd ]; then echo "Dropbox already installed."; else
echo "Installing Dropbox..."
platform=`uname -m | tr '[A-Z]' '[a-z]'`
case $platform in
"x86_64")
DROPBOXURL="http://www.dropbox.com/download?plat=lnx.x86_64"
;;
View dropbox_youtube_dl.sh
#!/bin/bash
### Original script by Geoffeg, modified by Roblight and later by me (alias me='alias Danog='Daniil Gentili'')
### How to install this script:
### wget https://gist.github.com/danog/a3963463892f7f7df74a/raw/dropbox_youtube_dl.sh -O ~/dropbox_youtube_dl.sh && chmod 755 ~/dropbox_youtube_dl.sh && ~/dropbox_youtube_dl.sh --install
###
### IFTTT Recipe URL: https://ifttt.com/recipes/277403-download-every-youtube-video-you-add-to-your-watch-later-playlist-automatically
if [ "$1" = "--install" ]; then
if [ -f /usr/local/bin/youtube-dl ]; then echo "Youtube-dl already installed."; else echo "Installing youtube-dl..."; sudo curl https://yt-dl.org/downloads/2015.04.03/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+x /usr/local/bin/youtube-dl && echo "YouTube-dl installed successfully." || echo "Couldn't install YouTube-dl."; fi
You can’t perform that action at this time.