pg_dump -U [superuser] -Fc [dbname] > db.dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config.namespace :admin do |admin| | |
| admin.build_menu :utility_navigation do |menu| | |
| menu.add :label => "Languages" do |lang| | |
| lang.add :label => "English",:url => proc { url_for(:locale => 'en') }, id: 'i18n-en', :priority => 1 | |
| lang.add :label => "Polish",:url => proc { url_for(:locale => 'pl') }, id: 'i18n-pl', :priority => 2 | |
| end | |
| menu.add id: 'current_user', label: -> { display_name(current_active_admin_user) }, if: :current_active_admin_user? do |usermenu| | |
| usermenu.add label: 'Profile', url: -> { auto_url_for(current_active_admin_user) } | |
| admin.add_logout_button_to_menu usermenu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # It extends activeadmin to show pretty boolean values | |
| # | |
| # config/initializers/active_admin.rb | |
| module ActiveAdmin | |
| module Views | |
| class TableFor | |
| def bool_column(attribute) | |
| column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| uninstall() { | |
| list=`gem list --no-versions` | |
| for gem in $list; do | |
| gem uninstall $gem -aIx | |
| done | |
| gem list | |
| gem install bundler | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Script to update motd with relevant information. | |
| #Define output file | |
| motd="/etc/motd" | |
| # Collect information | |
| HOSTNAME=`uname -n` | |
| KERNEL=`uname -r` | |
| CPU=`awk -F '[ :][ :]+' '/^model name/ { print $2; exit; }' /proc/cpuinfo` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Ramsey\Uuid\UuidInterface; | |
| trait EntityIdTrait | |
| { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| api: | |
| volumes: | |
| - "nfsmount:${CONTAINER_DIR}" | |
| volumes: | |
| nfsmount: | |
| driver: local | |
| driver_opts: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Check network interface name | |
| iwconfig | |
| # Start and stop interface | |
| ip link set {interface} up | |
| ip link set {interface} down | |
| # Search the available WiFi networks | |
| iwlist interface scan | less |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DISABLE | |
| SET session_replication_role = replica; | |
| ENABLE | |
| SET session_replication_role = DEFAULT; |
NewerOlder