This file contains 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
a = ["B$u$i$ld", "$t$$h$e", "N$e$x$t", "E$$ra", "$$o$f$", "S$$of$t$wa$r$e", "De$$ve$l$op$me$n$t"] | |
for i in a | |
i.to_s | |
i.gsub!('$', '') | |
puts "#{i.upcase}" | |
end | |
If your master.key has been compromised, you might want to regenerate it.
No key regeneration feature at the moment. We have to do it manually.
- Copy content of original credentials
rails credentials:show
somewhere temporarily. - Remove
config/master.key
andconfig/credentials.yml.enc
- Run
EDITOR=vim rails credentials:edit
in the terminal: This command will create a newmaster.key
andcredentials.yml.enc
if they do not exist. - Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
- Add and Commit the file
config/credentials.yml.enc
This file contains 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
I got solution from ask ubuntu and youtube chanel here the solution, its about python program: | |
# open terminal and run | |
$ sudo gedit /usr/lib/python3/dist-packages/kazam/pulseaudio/pulseaudio.py | |
# change all with this python code copy all after dash | |
------------------------------------------------------------------------- | |
# -*- coding: utf-8 -*- | |
# | |
# pulseaudio.py | |
# | |
# Copyright 2012 David Klasinc <[email protected]> |
This file contains 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
namespace :db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7" | |
task :backup => [:environment] do | |
datestamp = Time.now.strftime("%Y-%m-%d_%H-%M-%S") | |
base_path = Rails.root | |
base_path = File.join(base_path, ENV["DIR"] || "backups") | |
backup_base = File.join(base_path, 'db_backups') | |
backup_folder = File.join(backup_base, datestamp) | |
backup_file = File.join(backup_folder, "#{RAILS_ENV}_dump.sql") | |
FileUtils.mkdir_p(backup_folder) | |
db_config = ActiveRecord::Base.configurations[RAILS_ENV] |
This file contains 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
a = "halooooooooooo" | |
puts "a = halooooooooooo" | |
puts "Objek id dari a: #{a.object_id}" | |
b = a.upcase | |
puts "b = a.upcase" | |
puts b | |
puts "Objek id dari b: #{b.object_id}" |
This file contains 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
a = "234" | |
puts "a = 234" | |
puts "Contoh pakai to_i: #{a.to_i}" | |
b = "1234.5667" | |
puts "b = 1234.5667" | |
puts "Contoh b ada angka di belakangan: #{b.to_i}" | |
c = "abc" |
This file contains 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
a = "1234.567" | |
puts a | |
puts "Kelas awal #{a.class}" | |
b = a.to_f | |
puts b | |
puts "Kelas b #{b.class}" |
This file contains 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
a = "Pemrograman Ruby" | |
puts a | |
puts "Objek ID: #{a.object_id}" | |
b = a.swapcase | |
puts b | |
puts "Objek ID: #{b.object_id}" |
NewerOlder