How can I open the current file in a new pane in sublime text? - sublimetext2

I want to split a panel in two and open the current file in the new pane? I used to believe that alt+shift+2 would do the job. But it isn't working for me. How can I do it?

You can use multiple key bindings for that. Based on the file containing the default key-bindings:
alt+shift+2: set two column layout and focus on second group (currently empty second column).
ctrl+1: focus on first group.
ctrl+shift+2: move current file to second group (right column).
If you want to do it with a unique key-binding you can see this or this question and others that explain how to use a unique key-binding containing multiple commands.
Note: the given key-bindings work under Linux. Key-bidings on Windows or OS X may be different.

Related

SSIS - Loop Through Active Directory

Disclaimer: new to SSIS and Active Directory
I have a need to extract all users within a particular Active Directory (AD) domain and import them into Excel. I have followed this: https://www.itnota.com/query-ldap-in-visual-studio-ssis/ in order to create my SSIS package. My SQL is:
LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=a*));Name,sAMAccountName
As you know there is a 1,000 row limit when pulling from the AD. In my SQL I currently have (name=a*) to test the process and it works. I need to know how to setup a loop with variables to pull all records and import into Excel (or whatever you experts recommend). Also, how do I know what the other field names are that are available to pull?
Thanks in advance.
How do I see what's in Active Directory
Tool recommendations are off topic for the site but a tool that you can download, no install required, is AD Explorer It's a MS tool that allows you to view your domain. Highly recommend people that need to see what's in AD use something like this as it shows you your basic structure.
What's my domain controller?
Start -> Command Prompt
Type set | find /i "userdnsdomain" and look for USERDNSDOMAIN and put that value in the connect dialog and I save it because I don't want to enter this every time.
Search/Find and then look yourself up. Here I'm going to find my account by using my sAMAccountName
The search results show only one user but there could have been multiples since I did a contains relationship.
Double clicking the value in the bottom results section causes the under pane window to update with the details of the search result.
This is nice because while the right side shows all the properties associated to my account, it's also updated the left pane to navigate to the CN. In my case it's CN=Users but again, it could be something else in your specific environment.
You might discover an interesting categorization for your particular domain. At a very large client, I discovered that my target users were all under a CN
(Canonical Name, I think) so I could use that in my AD query.
There are things you'll see here that you sure would like to bring into a data flow but you won't be able to. Like the memberOf that's a complex type and there's no equivalent in the data flow data types for it. I think Integer8 is also something that didn't work.
Loop the loop
The "trick" here is that we'll need to take advantage of the
The name of the AD provider has changed since I last looked at this. In VS 2017, I see the OLE DB Provider name as "OLE DB Provider for Microsoft Directory Service"
Put in your query and you should get results back. Let that happen so the metadata is set.
An ADO.NET source does not support parameterization as the OLE DB does. However, you can apply an Expression on the Data Flow which surfaces the component and that's what we'll do.
Click out of the Data Flow and back into the Control Flow and right click on the Data Flow and select Properties. In that properties window, find Expressions and click the ellipses ... Up pops the Property Expressions Editor
Find the ADO.NET source under Property and in the Expressions section, click the Ellipses.
Here, we'll use your same source query just to prove we're doing the right things
"LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=" + "a" + "*));Name,sAMAccountName"
We're doing string building here so the problem we're left to solve is how we can substitute something for the "a" in the above query.
The laziest route would be to
Create an SSIS variable of type String called CurrentLetter and initialize it to a
Update the expression we just created to be "LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=" + #[USer::CurrentLetter] + "*));Name,sAMAccountName"
Add a Foreach Loop Container (FELC) to your Control Flow.
Configure the FELC with an enumerator of "Foreach Item Enumerator"
Click the Columns...
Click Add (this results in Column 0 with data type String) so click OK
Fill the collection with each letter of the alphabet
In the Variable Mappings tab, assign Variable User::CurrentLetter to Index 0
Click OK
Old blog posts on the matter because I like clicks
https://billfellows.blogspot.com/2011/04/active-directory-ssis-data-source.html
http://billfellows.blogspot.com/2013/11/biml-active-directory-ssis-data-source.html

Can't search by column name in PhpStorm

So I've tried many things but I can't search by column names on my entire database(mysql) with PhpStorm.
Is this feature available? If so how do I do it? If not, is there any plugin?
Try "Search everywhere" (shift+shift) or Navigate > Symbol (ctrl+alt+shift+N).
I've found a better way in my use cases:
Select your database tables 'directory'. Hit 'Numpad *' (Fully Expand Tree Node) to expand the tree.
Hit 'ctrl + f' to search column and table names in the folder.
It is way better than #Ástþór answer as it does not search css tags and other things.

Mysql multiple line requests

I'm new to MySQL and I am facing a little problem that I couldn't find an answer to in any previous thread here, so I was hoping someone could help, okay here it is:
When typing a request on mysql (on the terminal) you can just press enter to make it stand on many lines instead of one, but how do you get back to a previous line ?
I tried the arrow buttons and it didn't work, neither did the backspace button, any help is welcome, thank you in advance!
The mysql command uses the readline library. Each input line is edited independently, so once you press Return you can no longer go back and modify that line. The arrow keys will recall the line, but it's inserted into the current line being edited, and appends to the query.
So the solution is to NOT press Return until you've finished typing the whole query.
If you mean to show previously entered lines in order to send them again, according to the MySQL website, it should work via the up/down keys.
[...] the up-arrow and down-arrow keys move up and down through the set of previously entered line
http://dev.mysql.com/doc/refman/5.0/en/mysql-tips.html

edit phpmyadmin blob field

Huh.
In the same vein as Viewing Content Of Blob In phpMyAdmin, i have a blob.
And just like in the screenshot of the given url, it says "blob". Thanks, phpmyadmin! You're the best!
Unlike the chap who asked the question above, though, I really want to edit the blob values, and then save them. So, if my blob has, as its text "ima blob yo" - and I can see that text, thanks to the solution given above - how do i edit that to "i am a blob, you".
I don't particularly want to upload a text file each time i edit a blob, that's totes bogue. Just want to edit it, as i would a text field.
cheers!
Ah. the phpmyadmin site, there this page: http://www.phpmyadmin.net/documentation/#faq1_31
$cfg['ProtectBinary'] boolean or string
Defines whether BLOB or BINARY columns are protected from editing when browsing a table's content. Valid values are:
* FALSE to allow editing of all columns;
* 'blob' to allow editing of all columns except BLOBS;
* 'all' to disallow editing of all BINARY or BLOB columns.
Ok, so that details how to allow me to edit my blobs.
I made the change
$cfg['ProtectBinary'] = FALSE;
$cfg['ShowBlob'] = TRUE;
and put these two as the last lines in my config.inc.php file, which, because i'm using UBUNTU and used the auto install sudo apt-get install phpmyadmin, was at /etc/phpmyadmin/
And everything worked, kinda. I can now edit my blobs... with the limitation that phpmyadmin shows the current contents of the blob in "blob-view", which is a whole bunch of numbers or some nonsense.
Simple solution i found was to:
write over the text. Simple editing isn't really an option, but luckily i didn't need to edit, just add in new data.
change the "function" option from ... i cannot remember what it was, but it was something crazy... to just "blank". That's the same kind of blank as the function option defaults for other values - ints etc
cheers,
andrew
PS that
$cfg['ShowBlob'] = TRUE;
was from the given url in the question i linked to. The poster states it isn't effective in phpmyadmin, but i only downloaded using a latest sudo-get a few months back, so it still works. Actually, i needed to put that value in to get editing to work.
I'm using phpMyAdmin v4.6.4. I find an option on GUI to set this config.
You can click on Home button. Then click on Panel Appearance settings.
In this screen, click on Main panel tab, then Edit mode tab.
After that, select 'no' in Protect binary columns dropdown.
Edit mode tab
If your BLOB field is really only text, then you might consider converting your BLOB field to a TEXT field (there should be no loss of data in the process). TEXT fields are viewable/editable directly from phpMyAdmin.

Is there any way to reorder fields in an SSIS flat file source?

I have an SSIS package using a tab delimited flat file source with a TON of fields. Recently the provider of the tab delimited flat file has decided to change the format of the flat file by sprinkling a couple dozen new fields at random into the file. Needless to say, this hosed the package.
Rather than rebuild another flat file source and redefine all the fields, types, and lengths all over again, is there a way to reorder the fields in the flat file source? Sure would have been nice if Microsoft allowed you to move the fields around in the Advanced Columns pane, but noooooo.
Any help is appreciated.
If you only need to add columns to your file, you can do that in the Flat File connection editor. In the advanced window, you can select the field next to the new one and click the chevron next to the New button. It will give you the choice insert before or insert after.
If you truly have to move things around, you'll need to edit the XML source. If you use the existing file definition as a guide, you can build the new one in Excel or T-SQL relatively easily. Easier than typing everything in all over again at least.
I had a similar issue: I needed to change the order of columns in my flat file destination. The time-saving approach I settled on:
Delete the FF destination and FF connection manager (note down file name/location!),
Clear the check boxes that enable output columns in the source component
Re-enable the columns in the order you want
Add a new FF destination and FF connection right from the FF destination's connection manager drop-down.
Review/sanity check column sizes in FF connection, as usual
Not a direct answer to the question, but I came here looking for advice on "how to rearrange flat file destination columns", perhaps this will help someone.
I haven't seen an solution for that problem. SSIS isn't very strong in changing metadata. You could try to do it in notepad, but that is very tricky and very buggy. I would not recommand that to you.
In the connection managers below of your IDE you can double click your file name and edit everything you want.
This is still a "feature" of SSIS. To work around this I create a flat file connection called "NULL" with a single column named "NULL". Use the "New" button to add the column. I change the default column name from "Column 0" to "NULL". This column name must not match any column name in the list to be re-populated. If you have a real column named "NULL", pick something else for the column name that's not in use. You can keep the "NULL" flat file connection in the project for later use. (I expect to need it a few more times in this project.)
For this example, I use a flat file destination. Change the Flat File Destination to use the NULL connection.
Check the mapping to see there are no columns mapped. Saving this resets the metadata stored for the mapping.
Finally, change the Flat File Destination back to the correct connection to get a new mapping without metadata interference.
My example is a flat file destination. It should work for a flat file source for resetting the metadata. It is similar to the trick of changing a query to "select 1 as [NULL]" and back to purge metadata when using a ODBC source or such.
you could probably try something, but i havent tested.. use expressions to set everything for your flat file source? turn design time validation off