davideisinger.com

My personal website
Log | Files | Refs | README

techoverflow-net-fvl0ss.txt (18420B)


      1   • [1]Consulting
      2   • [2]Publications
      3   • [3]Tools
      4       □ [4]Why is my PowerPoint (.pptx) so large?
      5 
      6 [5]TechOverflowTechOverflowTechOverflow
      7 
      8   • [6]Consulting
      9   • [7]Publications
     10   • [8]Tools
     11       □ [9]Why is my PowerPoint (.pptx) so large?
     12 
     13 Create a systemd service for your docker-compose project in 10 seconds
     14 
     15 Run this in the directory where docker-compose.yml is located:
     16 
     17 curl -fsSL https://techoverflow.net/scripts/create-docker-compose-service.sh | sudo bash /dev/stdin
     18 
     19 This script will automatically create  a systemd service that
     20 starts docker-compose up and shuts down using docker-compose down. Our script
     21 will also systemctl enable the script (i.e. start automatically on boot)
     22 and systemctl start it (start it immediately).
     23 
     24 How it works
     25 
     26 The command above will download the script from TechOverflow and run it in
     27 bash:
     28 
     29 #!/bin/bash
     30 # Create a systemd service that autostarts & manages a docker-compose instance in the current directory
     31 # by Uli Köhler - https://techoverflow.net
     32 # Licensed as CC0 1.0 Universal
     33 SERVICENAME=$(basename $(pwd))
     34 
     35 echo "Creating systemd service... /etc/systemd/system/${SERVICENAME}.service"
     36 # Create systemd service file
     37 sudo cat >/etc/systemd/system/$SERVICENAME.service <<EOF
     38 [Unit]
     39 Description=$SERVICENAME
     40 Requires=docker.service
     41 After=docker.service
     42 
     43 [Service]
     44 Restart=always
     45 User=root
     46 Group=docker
     47 WorkingDirectory=$(pwd)
     48 # Shutdown container (if running) when unit is started
     49 ExecStartPre=$(which docker-compose) -f docker-compose.yml down
     50 # Start container when unit is started
     51 ExecStart=$(which docker-compose) -f docker-compose.yml up
     52 # Stop container when unit is stopped
     53 ExecStop=$(which docker-compose) -f docker-compose.yml down
     54 
     55 [Install]
     56 WantedBy=multi-user.target
     57 EOF
     58 
     59 echo "Enabling & starting $SERVICENAME"
     60 # Autostart systemd service
     61 sudo systemctl enable $SERVICENAME.service
     62 # Start systemd service now
     63 sudo systemctl start $SERVICENAME.service
     64 
     65 The service name is the directory name:
     66 
     67 SERVICENAME=$(basename $(pwd))
     68 
     69 Now we will create the service file in /etc/systemd/system/$
     70 {SERVICENAME}.service using the template embedded in the script
     71 
     72 The script will automatically determine the location of docker-composeusing $
     73 (which docker-compose) and finally enable and start the systemd service:
     74 
     75 # Autostart systemd service
     76 sudo systemctl enable $SERVICENAME.service
     77 # Start systemd service now
     78 sudo systemctl start $SERVICENAME.service
     79 
     80  
     81 
     82 *
     83 
     84 If this post helped you, please consider buying me a coffee or donating via
     85 PayPal to support research & publishing of new posts on TechOverflow
     86 
     87 
     88 Donate with PayPal button
     89 Search
     90 
     91 [12][                    ] [13][]
     92 Categories
     93 
     94   • [15]3D printing (46)
     95   • [16]Algorithms (6)
     96   • [17]Allgemein (90)
     97   • [18]Android (4)
     98   • [19]APIs (1)
     99   • [20]Arduino (7)
    100   • [21]Audio (8)
    101   • [22]Audio/Video (29)
    102   • [23]Backup (3)
    103   • [24]Bioinformatics (23)
    104   • [25]CAD (1)
    105   • [26]Calculators (28)
    106   • [27]cloud-init (1)
    107   • [28]Container (178)
    108       □ [29]CoreOS (16)
    109       □ [30]Docker (132)
    110       □ [31]Kubernetes (11)
    111       □ [32]LXC (16)
    112       □ [33]Podman (2)
    113       □ [34]Portainer (3)
    114   • [35]Cryptography (11)
    115   • [36]Data science (11)
    116   • [37]Documentation (1)
    117   • [38]E-Mail (3)
    118   • [39]Economics (1)
    119   • [40]Electronics (665)
    120       □ [41]Analog (5)
    121       □ [42]Compliance (8)
    122       □ [43]Components (29)
    123       □ [44]DALI (3)
    124       □ [45]Embedded (426)
    125           ☆ [46]Arduino (89)
    126           ☆ [47]EFM8 (4)
    127           ☆ [48]ESP8266/ESP32 (163)
    128           ☆ [49]FreeRTOS (14)
    129           ☆ [50]LVGL (6)
    130           ☆ [51]mbed (16)
    131           ☆ [52]MicroPython (15)
    132           ☆ [53]NanoPB (2)
    133           ☆ [54]PlatformIO (154)
    134           ☆ [55]Raspberry Pi (60)
    135           ☆ [56]STM32 (34)
    136           ☆ [57]Teensy (10)
    137       □ [58]EMI (3)
    138       □ [59]FPGA (1)
    139       □ [60]Home-Assistant (10)
    140       □ [61]KiCAD (49)
    141       □ [62]LinuxCNC (6)
    142       □ [63]LumenPnP (3)
    143       □ [64]Medical devices (6)
    144       □ [65]Optoelectronics (1)
    145       □ [66]SPICE (4)
    146       □ [67]Teardown (1)
    147   • [68]Frameworks (58)
    148       □ [69]CadQuery (12)
    149       □ [70]ImageMagick (2)
    150       □ [71]InvenTree (11)
    151       □ [72]Wordpress (33)
    152   • [73]Fun (1)
    153   • [74]Generators (4)
    154   • [75]Geography (24)
    155       □ [76]Leaflet (1)
    156       □ [77]OpenStreetMap (4)
    157   • [78]Geoinformatics (5)
    158   • [79]Hardware (7)
    159   • [80]Linux (347)
    160       □ [81]Alpine Linux (30)
    161       □ [82]systemd (16)
    162   • [83]Machine learning (2)
    163   • [84]Mathematics (10)
    164   • [85]Networking (350)
    165       □ [86]FreePBX (13)
    166       □ [87]MikroTik (59)
    167       □ [88]MQTT (28)
    168           ☆ [89]EMQX (8)
    169       □ [90]nginx (30)
    170       □ [91]OpenWRT (14)
    171       □ [92]PoE (8)
    172       □ [93]SNMP (7)
    173       □ [94]Synology (1)
    174       □ [95]Tactical RMM (1)
    175       □ [96]VPN (41)
    176           ☆ [97]Headscale (15)
    177           ☆ [98]OpenVPN (2)
    178           ☆ [99]Wireguard (24)
    179       □ [100]ZeroTier (9)
    180   • [101]Nextcloud (11)
    181   • [102]OpenCASCADE (33)
    182   • [103]Patents (1)
    183   • [104]PDF (5)
    184   • [105]Performance (4)
    185   • [106]Physics (7)
    186   • [107]Programming languages (1,105)
    187       □ [108]C/C++ (318)
    188           ☆ [109]Boost (31)
    189           ☆ [110]GCC errors (51)
    190       □ [111]C# (4)
    191       □ [112]CSS (1)
    192       □ [113]Go (9)
    193       □ [114]Haskell (8)
    194       □ [115]Haxe (2)
    195       □ [116]HTML (7)
    196       □ [117]Java (7)
    197       □ [118]Javascript (146)
    198           ☆ [119]Angular (33)
    199           ☆ [120]NodeJS (58)
    200       □ [121]LaTeX (22)
    201       □ [122]Octave (13)
    202       □ [123]PHP (23)
    203       □ [124]Python (516)
    204           ☆ [125]Cartopy (15)
    205           ☆ [126]OpenPyXL (7)
    206           ☆ [127]pandas (52)
    207           ☆ [128]Paramiko (4)
    208           ☆ [129]skyfield (6)
    209       □ [130]R (13)
    210       □ [131]Ruby (3)
    211       □ [132]Shell (19)
    212       □ [133]Typescript (23)
    213   • [134]Project management (78)
    214       □ [135]Build systems (51)
    215           ☆ [136]CMake (26)
    216           ☆ [137]Conan (17)
    217           ☆ [138]SCons (2)
    218       □ [139]Version management (25)
    219           ☆ [140]git (24)
    220           ☆ [141]Subversion (2)
    221   • [142]Security (5)
    222   • [143]Statistics (8)
    223   • [144]Technologies (224)
    224       □ [145]bup (10)
    225       □ [146]Cloud (34)
    226       □ [147]Databases (72)
    227           ☆ [148]ElasticSearch (34)
    228           ☆ [149]MongoDB (9)
    229           ☆ [150]SQLite (6)
    230       □ [151]GitLab (7)
    231       □ [152]GPU (1)
    232       □ [153]Jupyter (5)
    233       □ [154]LLVM (2)
    234       □ [155]OpenCV (10)
    235       □ [156]Puppeteer (29)
    236           ☆ [157]Pyppeteer (13)
    237       □ [158]S3 (21)
    238       □ [159]Traefik (17)
    239       □ [160]Virtualization (18)
    240       □ [161]WASM (1)
    241       □ [162]Zigbee (1)
    242   • [163]TechOverflow (2)
    243   • [164]veeam (2)
    244   • [165]Video (7)
    245   • [166]Windows (17)
    246       □ [167]PowerShell (4)
    247 
    248   • [168]Impressum & Datenschutz
    249 
    250 © 2024 TechOverflow. Bento theme by Satori
    251 This website uses cookies to improve your experience. We'll assume you're ok
    252 with this, but you can opt-out if you wish. Cookie settingsACCEPTPrivacy &amp;
    253 Cookies Policy
    254 Close
    255 
    256 Privacy Overview
    257 
    258 This website uses cookies to improve your experience while you navigate through
    259 the website. Out of these cookies, the cookies that are categorized as
    260 necessary are stored on your browser as they are essential for the working of
    261 basic functionalities of the website. We also use third-party cookies that help
    262 us analyze and understand how you use this website. These cookies will be
    263 stored in your browser only with your consent. You also have the option to
    264 opt-out of these cookies. But opting out of some of these cookies may have an
    265 effect on your browsing experience.
    266 Necessary
    267 [170][*] Necessary
    268 Always Enabled
    269 Necessary cookies are absolutely essential for the website to function
    270 properly. This category only includes cookies that ensures basic
    271 functionalities and security features of the website. These cookies do not
    272 store any personal information.
    273 Non-necessary
    274 [171][*] Non-necessary
    275 Any cookies that may not be particularly necessary for the website to function
    276 and is used specifically to collect user personal data via analytics, ads,
    277 other embedded contents are termed as non-necessary cookies. It is mandatory to
    278 procure user consent prior to running these cookies on your website.
    279 SAVE & ACCEPT
    280 
    281 References:
    282 
    283 [1] https://techoverflow.net/consulting/
    284 [2] https://techoverflow.net/publications/
    285 [3] https://techoverflow.net/2020/10/24/create-a-systemd-service-for-your-docker-compose-project-in-10-seconds/#
    286 [4] https://techoverflow.net/why-is-my-powerpoint-pptx-so-large/
    287 [5] https://techoverflow.net/
    288 [6] https://techoverflow.net/consulting/
    289 [7] https://techoverflow.net/publications/
    290 [8] https://techoverflow.net/2020/10/24/create-a-systemd-service-for-your-docker-compose-project-in-10-seconds/#
    291 [9] https://techoverflow.net/why-is-my-powerpoint-pptx-so-large/
    292 [15] https://techoverflow.net/category/3d-printing/
    293 [16] https://techoverflow.net/category/algorithms/
    294 [17] https://techoverflow.net/category/allgemein/
    295 [18] https://techoverflow.net/category/android/
    296 [19] https://techoverflow.net/category/apis/
    297 [20] https://techoverflow.net/category/arduino/
    298 [21] https://techoverflow.net/category/audio/
    299 [22] https://techoverflow.net/category/audio-video/
    300 [23] https://techoverflow.net/category/backup/
    301 [24] https://techoverflow.net/category/bioinformatics/
    302 [25] https://techoverflow.net/category/cad/
    303 [26] https://techoverflow.net/category/calculators/
    304 [27] https://techoverflow.net/category/cloud-init/
    305 [28] https://techoverflow.net/category/container/
    306 [29] https://techoverflow.net/category/container/coreos/
    307 [30] https://techoverflow.net/category/container/docker/
    308 [31] https://techoverflow.net/category/container/kubernetes/
    309 [32] https://techoverflow.net/category/container/lxc/
    310 [33] https://techoverflow.net/category/container/podman/
    311 [34] https://techoverflow.net/category/container/portainer/
    312 [35] https://techoverflow.net/category/cryptography/
    313 [36] https://techoverflow.net/category/data-science/
    314 [37] https://techoverflow.net/category/documentation/
    315 [38] https://techoverflow.net/category/e-mail/
    316 [39] https://techoverflow.net/category/economics/
    317 [40] https://techoverflow.net/category/electronics/
    318 [41] https://techoverflow.net/category/electronics/analog/
    319 [42] https://techoverflow.net/category/electronics/compliance/
    320 [43] https://techoverflow.net/category/electronics/components/
    321 [44] https://techoverflow.net/category/electronics/dali/
    322 [45] https://techoverflow.net/category/electronics/embedded/
    323 [46] https://techoverflow.net/category/electronics/embedded/arduino-embedded/
    324 [47] https://techoverflow.net/category/electronics/embedded/efm8/
    325 [48] https://techoverflow.net/category/electronics/embedded/esp8266-esp32/
    326 [49] https://techoverflow.net/category/electronics/embedded/freertos/
    327 [50] https://techoverflow.net/category/electronics/embedded/lvgl/
    328 [51] https://techoverflow.net/category/electronics/embedded/mbed/
    329 [52] https://techoverflow.net/category/electronics/embedded/micropython/
    330 [53] https://techoverflow.net/category/electronics/embedded/nanopb/
    331 [54] https://techoverflow.net/category/electronics/embedded/platformio/
    332 [55] https://techoverflow.net/category/electronics/embedded/raspberry-pi/
    333 [56] https://techoverflow.net/category/electronics/embedded/stm32/
    334 [57] https://techoverflow.net/category/electronics/embedded/teensy/
    335 [58] https://techoverflow.net/category/electronics/emi/
    336 [59] https://techoverflow.net/category/electronics/fpga/
    337 [60] https://techoverflow.net/category/electronics/home-assistant/
    338 [61] https://techoverflow.net/category/electronics/kicad/
    339 [62] https://techoverflow.net/category/electronics/linuxcnc/
    340 [63] https://techoverflow.net/category/electronics/lumenpnp/
    341 [64] https://techoverflow.net/category/electronics/medical-devices/
    342 [65] https://techoverflow.net/category/electronics/optoelectronics/
    343 [66] https://techoverflow.net/category/electronics/spice/
    344 [67] https://techoverflow.net/category/electronics/teardown/
    345 [68] https://techoverflow.net/category/frameworks/
    346 [69] https://techoverflow.net/category/frameworks/cadquery/
    347 [70] https://techoverflow.net/category/frameworks/imagemagick/
    348 [71] https://techoverflow.net/category/frameworks/inventree/
    349 [72] https://techoverflow.net/category/frameworks/wordpress/
    350 [73] https://techoverflow.net/category/fun/
    351 [74] https://techoverflow.net/category/generators/
    352 [75] https://techoverflow.net/category/geography/
    353 [76] https://techoverflow.net/category/geography/leaflet/
    354 [77] https://techoverflow.net/category/geography/openstreetmap/
    355 [78] https://techoverflow.net/category/geoinformatics/
    356 [79] https://techoverflow.net/category/hardware/
    357 [80] https://techoverflow.net/category/linux/
    358 [81] https://techoverflow.net/category/linux/alpine-linux/
    359 [82] https://techoverflow.net/category/linux/systemd/
    360 [83] https://techoverflow.net/category/machine-learning/
    361 [84] https://techoverflow.net/category/mathematics/
    362 [85] https://techoverflow.net/category/networking/
    363 [86] https://techoverflow.net/category/networking/freepbx/
    364 [87] https://techoverflow.net/category/networking/mikrotik/
    365 [88] https://techoverflow.net/category/networking/mqtt/
    366 [89] https://techoverflow.net/category/networking/mqtt/emqx/
    367 [90] https://techoverflow.net/category/networking/nginx/
    368 [91] https://techoverflow.net/category/networking/openwrt/
    369 [92] https://techoverflow.net/category/networking/poe/
    370 [93] https://techoverflow.net/category/networking/snmp/
    371 [94] https://techoverflow.net/category/networking/synology/
    372 [95] https://techoverflow.net/category/networking/tactical-rmm/
    373 [96] https://techoverflow.net/category/networking/vpn/
    374 [97] https://techoverflow.net/category/networking/vpn/headscale/
    375 [98] https://techoverflow.net/category/networking/vpn/openvpn/
    376 [99] https://techoverflow.net/category/networking/vpn/wireguard/
    377 [100] https://techoverflow.net/category/networking/zerotier/
    378 [101] https://techoverflow.net/category/nextcloud/
    379 [102] https://techoverflow.net/category/opencascade/
    380 [103] https://techoverflow.net/category/patents/
    381 [104] https://techoverflow.net/category/pdf/
    382 [105] https://techoverflow.net/category/performance/
    383 [106] https://techoverflow.net/category/physics/
    384 [107] https://techoverflow.net/category/programming-languages/
    385 [108] https://techoverflow.net/category/programming-languages/c-cpp/
    386 [109] https://techoverflow.net/category/programming-languages/c-cpp/boost/
    387 [110] https://techoverflow.net/category/programming-languages/c-cpp/gcc-errors/
    388 [111] https://techoverflow.net/category/programming-languages/c/
    389 [112] https://techoverflow.net/category/programming-languages/css/
    390 [113] https://techoverflow.net/category/programming-languages/go/
    391 [114] https://techoverflow.net/category/programming-languages/haskell/
    392 [115] https://techoverflow.net/category/programming-languages/haxe/
    393 [116] https://techoverflow.net/category/programming-languages/html/
    394 [117] https://techoverflow.net/category/programming-languages/java/
    395 [118] https://techoverflow.net/category/programming-languages/javascript/
    396 [119] https://techoverflow.net/category/programming-languages/javascript/angular/
    397 [120] https://techoverflow.net/category/programming-languages/javascript/nodejs/
    398 [121] https://techoverflow.net/category/programming-languages/latex/
    399 [122] https://techoverflow.net/category/programming-languages/octave/
    400 [123] https://techoverflow.net/category/programming-languages/php/
    401 [124] https://techoverflow.net/category/programming-languages/python/
    402 [125] https://techoverflow.net/category/programming-languages/python/cartopy/
    403 [126] https://techoverflow.net/category/programming-languages/python/openpyxl-python/
    404 [127] https://techoverflow.net/category/programming-languages/python/pandas/
    405 [128] https://techoverflow.net/category/programming-languages/python/paramiko/
    406 [129] https://techoverflow.net/category/programming-languages/python/skyfield/
    407 [130] https://techoverflow.net/category/programming-languages/r/
    408 [131] https://techoverflow.net/category/programming-languages/ruby/
    409 [132] https://techoverflow.net/category/programming-languages/shell/
    410 [133] https://techoverflow.net/category/programming-languages/typescript/
    411 [134] https://techoverflow.net/category/project-management/
    412 [135] https://techoverflow.net/category/project-management/build-systems/
    413 [136] https://techoverflow.net/category/project-management/build-systems/cmake/
    414 [137] https://techoverflow.net/category/project-management/build-systems/conan/
    415 [138] https://techoverflow.net/category/project-management/build-systems/scons/
    416 [139] https://techoverflow.net/category/project-management/version-management/
    417 [140] https://techoverflow.net/category/project-management/version-management/git/
    418 [141] https://techoverflow.net/category/project-management/version-management/subversion/
    419 [142] https://techoverflow.net/category/security/
    420 [143] https://techoverflow.net/category/statistics/
    421 [144] https://techoverflow.net/category/technologies/
    422 [145] https://techoverflow.net/category/technologies/bup/
    423 [146] https://techoverflow.net/category/technologies/cloud/
    424 [147] https://techoverflow.net/category/technologies/databases/
    425 [148] https://techoverflow.net/category/technologies/databases/elasticsearch/
    426 [149] https://techoverflow.net/category/technologies/databases/mongodb/
    427 [150] https://techoverflow.net/category/technologies/databases/sqlite/
    428 [151] https://techoverflow.net/category/technologies/gitlab/
    429 [152] https://techoverflow.net/category/technologies/gpu/
    430 [153] https://techoverflow.net/category/technologies/jupyter/
    431 [154] https://techoverflow.net/category/technologies/llvm/
    432 [155] https://techoverflow.net/category/technologies/opencv/
    433 [156] https://techoverflow.net/category/technologies/puppeteer/
    434 [157] https://techoverflow.net/category/technologies/puppeteer/pyppeteer/
    435 [158] https://techoverflow.net/category/technologies/s3/
    436 [159] https://techoverflow.net/category/technologies/traefik/
    437 [160] https://techoverflow.net/category/technologies/virtualization/
    438 [161] https://techoverflow.net/category/technologies/wasm/
    439 [162] https://techoverflow.net/category/technologies/zigbee/
    440 [163] https://techoverflow.net/category/techoverflow/
    441 [164] https://techoverflow.net/category/veeam/
    442 [165] https://techoverflow.net/category/video/
    443 [166] https://techoverflow.net/category/windows/
    444 [167] https://techoverflow.net/category/windows/powershell/
    445 [168] https://techoverflow.net/impressum-datenschutz/