Skip to content

Instantly share code, notes, and snippets.

Avatar

Enrico Stano enricostano

  • Barcelona, Spain
View GitHub Profile
View gist:73fa78af75b0d70c731b
abr 20 17:03:26 archlap systemd[1]: Started Locale Service.
abr 20 17:04:57 archlap gnome-session[2152]: WARNING: Application 'i3-gnome.desktop' failed to register before timeout
abr 20 17:04:57 archlap gnome-session[2152]: Unrecoverable failure in required component i3-gnome.desktop
abr 20 17:04:57 archlap gnome-session[2152]: gnome-session[2152]: WARNING: Application 'i3-gnome.desktop' failed to register before timeout
abr 20 17:04:57 archlap gnome-session[2152]: Entering running state
abr 20 17:04:57 archlap gnome-session[2152]: Failed to play sound: File or data not found
abr 20 17:05:09 archlap gnome-session[2152]: gnome-session[2152]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
abr 20 17:05:09 archlap gnome-session[2152]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
abr 20 17:05:09 archlap gnome-session[2152]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
abr 20 17:05:09 archlap gnome-session[2152]: gno
View dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
@enricostano
enricostano / eth0.network
Created Apr 3, 2015
/etc/systemd/network/eth0.network
View eth0.network
[Match]
Name=eth0
[Network]
DHCP=v4
View journal2
dic 10 23:16:51 alarmpi systemd[1]: Started Network Service.
dic 10 23:16:51 alarmpi kernel: smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
dic 10 23:16:51 alarmpi kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
dic 10 23:16:51 alarmpi systemd-logind[136]: New seat seat0.
dic 10 23:16:51 alarmpi systemd[1]: Started Login Service.
dic 10 23:16:51 alarmpi systemd[1]: Starting Network.
dic 10 23:16:51 alarmpi systemd[1]: Reached target Network.
dic 10 23:16:51 alarmpi systemd[1]: Starting OpenSSH Daemon...
dic 10 23:16:51 alarmpi systemd[1]: Started OpenSSH Daemon.
dic 10 23:16:51 alarmpi systemd[1]: Starting Network Name Resolution...
View journal
λ sudo strings root/var/log/journal/321b13bd037b4883b3d2208a2f376f0e/system.journal | grep -i eth0
MESSAGE=smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
MESSAGE=IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
MESSAGE=smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
MESSAGE=IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
INTERFACE=eth0
MESSAGE=eth0 : gained carrier
MESSAGE=eth0 : lost carrier
MESSAGE=smsc95xx 1-1.1:1.0 eth0: link down
MESSAGE=smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:23:b2:23
@enricostano
enricostano / lazyness.rb
Last active Aug 29, 2015
lazy iterator
View lazyness.rb
arr = [1, 2, 3, 4, 5, 6, 7, 8]
[
[1, 2, 3, 4, 5],
[2, 3, 4, 5, 6],
[3, 4, 5, 6, 7],
[4, 5, 6, 7, 8],
[5, 6, 7, 8],
[6, 7, 8],
[7, 8],
View gist:182f0bbb03ec4581e925
SELECT users.id FROM users WHERE users.id IN (SELECT m2.user_id FROM memberships AS m1 INNER JOIN memberships AS m2 ON (m1.user_id = 3 AND m2.group_id = m1.group_id));
SELECT users.id FROM users INNER JOIN memberships AS m1 ON (users.id = m1.user_id) INNER JOIN memberships AS m2 ON (m1.group_id = m2.group_id) WHERE m2.user_id = 3;
@enricostano
enricostano / foo_bar.rb
Created Aug 22, 2014
Ruby class variables
View foo_bar.rb
class FooBar
class << self
attr_accessor :variabile
def hola
p variabile
end
View app.js
'use strict';
require("../../lib/bootstrap-3.1.1-dist/css/bootstrap.css");
require("../styles/main.css");
require("imports?jQuery=jquery!../../lib/bootstrap-3.1.1-dist/js/bootstrap.js");
var Backbone = require("backbone")
, Marionette = require("backbone.marionette")
, headerLayoutTemplate = require("../templates/header.handlebars")
, Katuma = new Marionette.Application({});
View modules.rb
module Alfa
def self.included(base)
puts "#{self} included in #{base}"
unless base.const_defined?(:PAPPA)
base.const_set :PAPPA, [:a, :b]
end
end
def self.extended(base)
puts "#{self} extended in #{base}"