Skip to content

Instantly share code, notes, and snippets.

View gauravbarthwal's full-sized avatar

Gaurav Barthwal gauravbarthwal

  • Hyderabad, India
View GitHub Profile
@gauravbarthwal
gauravbarthwal / Multi-Part zip extraction in Ubuntu.txt
Last active October 14, 2024 17:40
How to extract multi-part .zip, .z01, .z02 files in ubuntu
Download/Copy all related *.zip files in one directory.
Open terminal and change to that directory which has all zip files.
Enter command zip -s- FILE_NAME.zip -O COMBINED_FILE.zip
Enter unzip COMBINED_FILE.zip
@gauravbarthwal
gauravbarthwal / How to delete a directory which contains filename more than 255 characters
Last active December 28, 2015 07:26
How to delete a directory which contains filename more than 255 characters
Create a new empty folder, e.g. c:\empty
Then copy that empty folder onto the folder which contains the long filenames which you're trying to delete, e.g. c:\myannoyingfolder. Do this like so in the command prompt:
robocopy /MIR c:\empty c:\myannoyingfolder
@gauravbarthwal
gauravbarthwal / Connecting device to Android Studio on Ubuntu
Created May 11, 2015 11:25
How to run android app on device using Android Studio in Ubuntu
Steps to connect device with Android Studio in Ubuntu:-
1. Enable USB debugging on your device.
2. Go to root and create a file: sudo vi /etc/udev/rules.d/51-android.rules
a. Add the following text in the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
** Note: vendor id is different for each company.
Company USB Vendor ID
Acer 0502
ASUS 0b05
Dell 413c
In RDS to change Global timezone you have to be a super user. But unfortunately RDS doesn't give you super user's privileges. You can only change the session timezone but can't global. To solve this there are two approaches-
1- Your application should set the session timezone for RDS everytime whenever you are connecting with it.
Query- SET SESSION tine_zone = '+5:30';
2. Create a procedure in your mysql which does this thing for you everytime.
a.DELIMITER |
CREATE PROCEDURE mysql.store_time_zone ()
IF NOT (POSITION('rdsadmin@' IN CURRENT_USER()) = 1) THEN
SET SESSION time_zone = '+5:30';
END IF
|
###sets the global timezone
SET GLOBAL time_zone = '+5:30';
###sets the timezone for session
SET time_zone = '+5:30';
###to see the timezone of session and global
SELECT @@global.time_zone, @@session.time_zone;