$ sudo su
$ apt-get update
$ apt-get install s3cmd automysqlbackup
$ s3cmd --configure
# enter access key and secret and other details
$ vim /etc/default/automysqlbackup
# Set these variables
# USERNAME
# PASSWORD
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
-server | |
-Xms2g | |
-Xmx2g | |
-Xss16m | |
-XX:+UseConcMarkSweepGC | |
-XX:+CMSParallelRemarkEnabled | |
-XX:ConcGCThreads=4 | |
-XX:ReservedCodeCacheSize=128m | |
-XX:+AlwaysPreTouch | |
-XX:+TieredCompilation |
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
#!/bin/bash | |
# | |
# USAGE: wait_until_done PID | |
# | |
# wait_until_done watches a process passed in as the first argument waits until | |
# it finishes | |
# | |
# Print the header comment from this file, ducking the shebang line, and stopping a the first line that doesn't start with a hash | |
function print_header_comment { |
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
description "Tomcat Server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 10 5 | |
setuid tomcat | |
setgid tomcat |
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
def my_fun | |
vals = [] | |
(1..5).each do |i| | |
puts "my_fun i=#{i}" | |
begin | |
handle_catchable_errors do | |
vals << unsafe_fun(i) | |
end | |
rescue KnownError => e |
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
// find a game object in the active scene | |
using System.Linq; | |
GameObject worldGameObject = | |
GameObject.FindGameObjectsWithTag("World").ToList().Find(o => o.scene == activeScene); | |
if (worldGameObject != null) | |
{ | |
Debug.Log("SetTrigger: SceneExit" + worldGameObject.name); | |
worldGameObject.GetComponent<Animator>().SetTrigger("SceneExit"); | |
} | |
else |
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
# find them in a queue | |
queue = Sidekiq::Queue.new("default") | |
jobs = queue.map do |job| | |
if job.klass == '[JOB_CLASS]' | |
{job_id: job.jid, job_klass: job.klass, arguments: job.args} | |
end | |
end.compact | |
# the retry queue | |
retries = Sidekiq::RetrySet.new.select |
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
select * from | |
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v | |
where selected_date between '2018-07-01' and curdate() |
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
#!/bin/bash | |
case "${1:-''}" in | |
'start') | |
if test -f /tmp/selenium.pid | |
then | |
echo "Selenium is already running." | |
else | |
export DISPLAY=localhost:99.0 | |
java -Dwebdriver.gecko.driver="/usr/lib/geckodriver/geckodriver" -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid |
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
ironsource inventory reports CSV file for 2020-01-14 | |
can i process this file? | |
am i already processing an admob file? | |
am i processing a mopub config file? | |
download CSV file (FileImporter) | |
truncate stage table |