Listing posts

Displaying posts 146 - 150 of 328 in total
patchelf | modifying ELF executables and libraries
mouse 1043 · person cloud · link
Last update
2020-05-02
2020
05-02
«modify linux executable interpreter, library path, requirements»
1
2
3
4
5
6
apt install patchelf

patchelf \
  --set-interpreter /lib/ld-linux-x86-64.so.2 \
  --set-rpath       /opt/app/mylibs \
  ./elf-name

Source: github


~~~ * ~~~

Show active SSH tunnels and ports
mouse 1946 · person cloud · link
Last update
2020-05-02
2020
05-02
« — »
1
sudo lsof -i -n -P | egrep sshd

Source: Superuser
See also: SSH tunnel howto and hints


~~~ * ~~~

DLNA interactions/tools
Last update
2020-04-26
2020
04-26
« — »

ref

tools

ruby easy_upnp gem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'easy_upnp'

searcher = EasyUpnp::SsdpSearcher.new
devices = searcher.search 'ssdp:all'

device = devices.first
device.all_services

device.description

# client
service = device.service 'urn:schemas-upnp-org:service:ContentDirectory:1', validate_arguments: true
service.service_methods

service.GetSystemUpdateID

service.method_args :Browse
ris = service.Browse ObjectID: '0', BrowseFlag: 'BrowseDirectChildren'
ris2 = Nokogiri::XML.parse ris[:Result]
ris2.css('container').map{|e| e['id'] }

# client from static config
service2 = EasyUpnp::DeviceControlPoint.from_params service.to_params
service.GetSystemUpdateID

~~~ * ~~~

Ruby daemon
mouse 1422 · person cloud · link
Last update
2020-04-13
2020
04-13
« — »
1
2
3
4
5
6
7
8
9
10
11
12
13
if RUBY_VERSION >= "1.9"
  Process.daemon
else
  exit if fork    # stop being a process group leader
  Process.setsid  # become a process&session group leader
  exit if fork    # now we can never regain a controlling terminal
  Dir.chdir "/"   # ensure we don't keep any directory in use
  File.umask 0    # have complete control over our files (optional)
  # reopen standard descriptors to oblivion (or where we want)
  STDIN .reopen "/dev/null"
  STDOUT.reopen "/dev/null", "a"
  STDERR.reopen "/dev/null", "a"
end 

Source: stackoverflow linux daemonize, jstorimer.com post, MRI Process.daemon, daemons gem


~~~ * ~~~

Salame al cioccolato senza uova
mouse 1062 · person cloud · link
Last update
2020-04-13
2020
04-13
«alias tronchetto al cioccolato»
Cover original

Ingredienti:

  • 260gr cioccolato fondente
  • 250gr biscotti secchi
  • 150gr burro morbido
  • 50gr zucchero
  • 20ml grand marnier

Procedimento:

  1. Sciogliere il cioccolato a fiamma bassa

  2. Lavorare con una forchetta il burro ammorbidito insieme allo zucchero

  3. Incorporare il grand marnier a filo ottenendo una crema

  4. Incorporare il cioccolato tiepido

  5. Frantumare ed incorporare i biscotti

  6. Stendere su un foglio di carta da forno, farne una caramella e dare la forma di un salame

  7. Mettere in frigo per almeno 2 ore


Fonte: giallozafferano.it