Skip to content

Instantly share code, notes, and snippets.

View natanaeljr's full-sized avatar

Natanael Rabello natanaeljr

View GitHub Profile
Ruby Quickstart for Refugees:
--
# is a comment.
You don't need semicolons.
Ruby aims to be elegant and readable, so punctuation and boilerplate are
minimal.
--
@icemancast
icemancast / crontab
Created December 3, 2011 17:28
setup cron job
$ crontab -e
crontab -e Edit your crontab file, or create one if it doesn’t already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file (This option is only available on a few systems.)
* * * * * command to be executed
- - - - -
| | | | |
@cluther
cluther / example_trap.sh
Created March 27, 2012 14:11
Example SNMP Trap
# This sends an example trap from the NET-SNMP-EXAMPLES-MIB.
#
# Parameters are..
# -v2c = SNMP version.
# -c public = SNMP community
# 127.0.0.1 = Trap manager hostname or IP.
# 0 = System uptime.
# NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification = Trap OID
# netSnmpExampleHeartbeatRate i 60 = First (of optional many) variables bindings.
@ozh
ozh / gist:5439013
Created April 22, 2013 22:10
Crontab template
MAILTO=""
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@wandernauta
wandernauta / sp
Last active November 9, 2024 17:03
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@dergachev
dergachev / ssh-forward-clipboard.md
Last active October 13, 2024 05:26
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@gitaarik
gitaarik / git_submodules.md
Last active November 16, 2024 19:55
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@tgrrtt
tgrrtt / travis.yml
Last active January 10, 2021 17:58
Travis-CI Config File (.travis.yml)
# Set up notification options
notifications:
email:
recipients:
- [email protected]
- [email protected]
# change is when the repo status goes from pass to fail or vice versa
on_success: change
on_failure: always
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.