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
| SELECT | |
| table_schema as `Database`, | |
| table_name AS `Table`, | |
| round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
| FROM information_schema.TABLES | |
| ORDER BY (data_length + index_length) DESC; |
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
| @Grapes( | |
| [ | |
| @Grab(group='com.amazonaws', module='aws-java-sdk-s3', version='1.10.32') | |
| ] | |
| ) | |
| AmazonS3 s3Client = new AmazonS3Client() | |
| final static String S3_BUCKET = "my-s3-bucket" | |
| Statement allowRestrictedReadStatement = new Statement(Statement.Effect.Allow) |
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
| INSERT INTO company_user (id_company, id_user) | |
| SELECT | |
| (SELECT company.id | |
| FROM company | |
| WHERE company.name = '') AS id_company, | |
| user.id AS id_user | |
| FROM user | |
| WHERE user.id NOT IN (SELECT company_user.id_user | |
| FROM company_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
| SELECT DATE_SUB(now(), INTERVAL '1' DAY); |
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
| String rootPath = request.getServletContext().getRealPath(File.separator); | |
| LOGGER.warn("ROOT PATH: " + rootPath); | |
| File rootDir = new File(rootPath); | |
| System.out.println(rootDir.getAbsolutePath()); | |
| System.out.println("Getting all files in " + rootDir.getAbsolutePath() + " including those in subdirectories"); | |
| Collection<File> files = FileUtils.listFiles(rootDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE); | |
| for (File file : files) { | |
| LOGGER.warn("iScribes FILE: " + file.getAbsolutePath()); | |
| } |
NewerOlder