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 | |
# Check if a file path is provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <csv_file>" | |
exit 1 | |
fi | |
csv_file="$1" |
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
import org.jobrunr.jobs.states.StateName | |
import org.jobrunr.storage.PageRequest | |
import org.jobrunr.storage.StorageProvider | |
import org.springframework.stereotype.Service | |
@Service | |
class FailedJobEnqueuer( | |
private val storageProvider: StorageProvider, | |
) { | |
fun requeueFailedJobs(): List<String> { |
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
<source> | |
type tail | |
format multiline | |
format_firstline /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/ | |
format1 /^(?<datetime>[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) (?<Thread>\[(.*?)\]) (?<Log-Level>[A-Z]*) (?<Logger>(.+?(?=))) (?<separator>(-)) (?<message>.*)$/ | |
path /log/application-backend-dev.log | |
pos_file /log/pos/application-backend-dev-multiline.pos | |
tag spring-boot-logs | |
</source> |
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
from util.template_filters import calculate_date_date | |
app.add_template_filter(calculate_date_date) |
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
import datetime | |
from dateutil.relativedelta import relativedelta | |
def calculate_date_date(date_str, format_str): | |
start_date = datetime.datetime.strptime(date_str, format_str) | |
return relativedelta(datetime.datetime.now(), start_date).years |
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
package com.example.package; | |
import org.apache.log4j.FileAppender; | |
import org.apache.log4j.Layout; | |
import org.apache.log4j.helpers.LogLog; | |
import org.apache.log4j.spi.LoggingEvent; | |
import java.io.File; | |
import java.io.FileFilter; | |
import java.io.FileInputStream; |
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 | |
echo "Downloading latest Database dump from Sandbox Server" | |
AZURE_STORAGE_CONNECTION_STRING="" | |
AZURE_CONTAINER_NAME="" | |
AZURE_DB_ZIP_FILE_NAME=$(az storage blob list --connection-string "$AZURE_STORAGE_CONNECTION_STRING" --container-name "$AZURE_CONTAINER_NAME" --query "reverse(sort_by([], &properties.lastModified)[*].{name: name, lastModified: properties.lastModified})[:1]" --prefix "sandbox" | jq '.[0] | {name}.name') | |
AZURE_DB_ZIP_FILE_NAME=${AZURE_DB_ZIP_FILE_NAME//\"/} | |
echo $AZURE_DB_ZIP_FILE_NAME |
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 | |
AZURE_STORAGE_CONNECTION_STRING="" | |
FOLDER_NAME="data_"$(date +'%d-%m-%Y-%H-%M-%S') | |
MYSQL_USER_NAME="root" | |
MYSQL_USER_PASSWORD="" | |
MYSQL_DB_NAME_ARRAY=() | |
MONGO_DB_NAME_ARRAY=() | |
FOLDER_BACKUP_ARRAY=() | |
AZURE_STORAGE_CONTAINER_NAME="" | |
AZURE_BLOB_NAME="full_backup_"$(date +'%d-%m-%Y')".zip" |
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
sudo rm /usr/local/mysql | |
sudo rm -rf /usr/local/mysql* | |
sudo rm -rf /Library/StartupItems/MySQLCOM | |
sudo rm -rf /Library/PreferencePanes/My* | |
rm -rf ~/Library/PreferencePanes/My* | |
sudo rm -rf /Library/Receipts/mysql* | |
sudo rm -rf /Library/Receipts/MySQL* | |
sudo rm -rf /private/var/db/receipts/*mysql* |
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
//Lets assume value.questionUniqueId is coming from json response | |
var dataModel = $parse('data_' + value.questionUniqueId); | |
var dataModel1 = $parse(value.questionUniqueId + '_data'); | |
var labelsModel = $parse('labels_' + value.questionUniqueId); | |
var seriesModel = $parse('series_' + value.questionUniqueId); | |
dataModel.assign($scope, ['1', '2', '3', '4', '5']); | |
dataModel1.assign($scope, ['1', '2', '3', '4', '5']); | |
labelsModel.assign($scope, [ | |
[3, 0, 1, 4, 6] | |
]); |
NewerOlder