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
# In any database editor run SQL: | |
SELECT SID, SERIAL#, STATUS | |
FROM V$SESSION | |
WHERE USERNAME = '<SCHEME>'; | |
# then in SQLPlus: | |
exec rdsadmin.rdsadmin_util.kill(SID, SERIAL#); | |
# drop it: | |
drop user <username> cascade; |
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
echo "# | |
# This docker-compose file can deploy a whole Linkcare application. | |
# You should create a local.php and configure it for ws | |
# The frontend is automatically configured with the attached ws endpoint | |
client: | |
image: linkcare${APP_NAME}_client | |
ports: | |
- "${VIRTUAL_PORT_FRONTEND}:3000" | |
volumes: | |
- /var/www/${APP_NAME}/frontend:/var/www/html/docs |
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
#NOTE: before running commands check output list to remove | |
# remove untagged docker images: | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
#remove stopped docker containers: | |
docker rm $(docker ps -q -f status=exited) |
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
// to export and import Oracle database user as an alternative to old imp/exp utility can be used next commands: | |
// In sql editor run: | |
// export dump file in Oracle storage | |
DECLARE | |
hdnl NUMBER; | |
BEGIN | |
hdnl := DBMS_DATAPUMP.open( operation => 'EXPORT', job_mode => 'SCHEMA', job_name=>null); | |
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'dumpfile.dump', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file); | |
DBMS_DATAPUMP.add_file( handle => hdnl, filename => 'dumplog.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file); | |
DBMS_DATAPUMP.METADATA_FILTER(hdnl,'SCHEMA_EXPR','IN (''EXPORTED DB USER'')'); |
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
# GIVEN TWO CONTROLLERS, CatsController and DogsController: | |
class CatsController < ApplicationController | |
before_action :set_cat, only: [:show, :edit, :update, :destroy] | |
def new | |
@cat = Cat.new | |
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
Write a function called sumIntervals/sum_intervals that accepts an array of intervals, and returns the sum of all the interval lengths. Overlapping intervals should only be counted once. | |
Intervals | |
Intervals are represented by a pair of integers in the form of an array. The first value of the interval will always be less than the second value. Interval example: [1, 5] is an interval from 1 to 5. The length of this interval is 4. | |
Overlapping Intervals | |
List containing overlapping intervals: | |
[ | |
[1, 4], |